skylot/jadx · error · IOException

No data, can't read {} bytes

Error message

No data, can't read {} bytes

What it means

ParserStream.readInt8Array reads a fixed number of bytes from the underlying Android binary resource stream. If the input ends prematurely (InputStream.read returns -1) before all requested bytes are delivered, an IOException is thrown indicating the requested count could not be satisfied. This is a hard failure: truncated or corrupt binary data cannot be partially consumed.

Source

Thrown at jadx-core/src/main/java/jadx/core/xmlgen/ParserStream.java:84

		}
		int[] arr = new int[count];
		for (int i = 0; i < count; i++) {
			arr[i] = readInt32();
		}
		return arr;
	}

	public byte[] readInt8Array(int count) throws IOException {
		if (count == 0) {
			return EMPTY_BYTE_ARRAY;
		}
		readPos += count;
		byte[] arr = new byte[count];
		int pos = input.read(arr, 0, count);
		while (pos < count) {
			int read = input.read(arr, pos, count - pos);
			if (read == -1) {
				throw new IOException("No data, can't read " + count + " bytes");
			}
			pos += read;
		}
		return arr;
	}

	@Override
	public long skip(long count) throws IOException {
		readPos += count;
		long pos = input.skip(count);
		while (pos < count) {
			long skipped = input.skip(count - pos);
			if (skipped == 0) {
				throw new IOException("No data, can't skip " + count + " bytes");
			}
			pos += skipped;
		}
		return pos;

View on GitHub (pinned to e738a26571)

Solutions

  1. Verify the input file is a complete, valid APK/AXML by re-downloading or re-extracting it
  2. Inspect the file with aapt dump or apktool to confirm the resource table is intact
  3. Open an issue with jadx attaching the problematic file if it loads fine in other tools
  4. Upgrade jadx to the latest version — binary parser robustness improves over time

Example fix

// No caller-side code fix; the error indicates corrupt/truncated input.
// Validate the file before passing it to jadx:
ZipFile apk = new ZipFile(file);
if (apk.getEntry("resources.arsc").getSize() <= 0) {
    throw new IllegalArgumentException("resources.arsc is empty/truncated");
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate file completeness before parsing:
long expected = apkEntry.getSize();
long actual = Files.size(extractedFile);
if (actual < expected) {
    throw new IllegalArgumentException("Truncated resource file");
}

Type guard

// No type guard — IOException is checked at compile time
try {
    parser.decode(stream);
} catch (IOException e) { ... }

Try / catch

try {
    resTableParser.decode(inputStream);
} catch (IOException e) {
    if (e.getMessage().contains("No data, can't read")) {
        LOG.warn("Truncated resource input, skipping resources", e);
        jadxArgs.setSkipResources(true);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Called during parsing of Android resources.arsc, binary XML, or AXML files where a chunk header declares a field size but the stream has fewer bytes remaining. The read loop accumulates bytes via input.read(arr, pos, count - pos); if read returns -1 (EOF) on any iteration before pos reaches count, the exception fires.

Common situations: Truncated APK or resources.arsc file (interrupted download, incomplete unzip). Corrupt or obfuscated resource table where chunk sizes are deliberately mis-specified. Processing a non-APK/AXML file through the resource parser. Reading a file that is simultaneously being written or modified.

Related errors


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/5b1214ab2c433f39. Report an issue: GitHub.