{"record":{"id":"8bf37462928673bf","repo":"Tencent/tinker","slug":"error-reading-data-for-entry-getname-near-off","errorCode":null,"errorMessage":"Error reading data for ${entry.getName()} near offset ${bytesRead}","messagePattern":"Error reading data for (.+?) near offset (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"info","filePath":"third-party/tinker-ziputils/src/main/java/com/tencent/tinker/ziputils/ziputil/TinkerZipFile.java","lineNumber":581,"sourceCode":"                skip(cnt);\n                return len;\n            }\n        }*/\n    }\n    /** @hide */\n    /*public static class ZipInflaterInputStream extends InflaterInputStream {\n        private final ZipEntry entry;\n        private long bytesRead = 0;\n        public ZipInflaterInputStream(InputStream is, Inflater inf, int bsize, ZipEntry entry) {\n            super(is, inf, bsize);\n            this.entry = entry;\n        }\n        @Override public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {\n            final int i;\n            try {\n                i = super.read(buffer, byteOffset, byteCount);\n            } catch (IOException e) {\n                throw new IOException(\"Error reading data for \" + entry.getName() + \" near offset \"\n                        + bytesRead, e);\n            }\n            if (i == -1) {\n                if (entry.size != bytesRead) {\n                    throw new IOException(\"Size mismatch on inflated file: \" + bytesRead + \" vs \"\n                            + entry.size);\n                }\n            } else {\n                bytesRead += i;\n            }\n            return i;\n        }\n        @Override public int available() throws IOException {\n            if (closed) {\n                // Our superclass will throw an exception, but there's a jtreg test that\n                // explicitly checks that the InputStream returned from ZipFile.getInputStream\n                // returns 0 even when closed.\n                return 0;","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/third-party/tinker-ziputils/src/main/java/com/tencent/tinker/ziputils/ziputil/TinkerZipFile.java#L563-L599","documentation":"This IOException('Error reading data for <entry> near offset <bytesRead>') belongs to the ZipInflaterInputStream inner class, which in this fork of tinker-ziputils is commented out (the block starting '/*public static class ZipInflaterInputStream' at TinkerZipFile.java:569). It was designed to wrap any IOException from the underlying inflater read and add the entry name and the byte offset reached so far, then rethrow with the original as the cause. In this codebase as shipped it is unreachable dead code — the active getInputStream path does not throw this message.","triggerScenarios":"In upstream Android/Harmony (where the class is live): inflating an entry whose DEFLATE stream hits an I/O or data error mid-read, e.g. truncated compressed data or a corrupted deflate block, while reading through ZipFile.getInputStream. In this repository: never thrown, since the class is commented out.","commonSituations":"Truncated compressed entry bodies in partially downloaded APKs; storage-level read errors; in this fork specifically, searching logs for this message after upgrading from a build where the class was enabled.","solutions":["If you see this message, you are running a build where ZipInflaterInputStream is enabled (e.g. the Android platform zip or an older fork): treat it as data corruption and re-fetch the archive.","In this repository, no action is needed — the code is unreachable; do not add handling for it.","If you are re-enabling the class, keep the cause chain (the original IOException) when logging."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// only relevant on builds where ZipInflaterInputStream is enabled (not this fork)\ntry {\n    int n = in.read(buf);\n} catch (IOException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Error reading data for\")) {\n        // entry data corrupt mid-inflate: the cause holds the real failure\n        throw new IOException(\"Corrupt entry data: \" + e.getMessage(), e.getCause());\n    }\n    throw e;\n}","preventionTips":["Checksum-verify archives before inflating entries so corruption is caught up front.","In this fork, do not write handling for this message — the class is commented out.","When re-enabling the class, preserve the cause exception in logs."],"tags":["zip","dead-code","inflate","tinker"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}