void readNextBlockHeader() throws IOException { isLastBlock = stream.getNextIdatBit() != 0; compressionType = (byte) stream.getNextIdatBits(2); if (compressionType > 2) stream.error(); if (compressionType == UNCOMPRESSED) { byte b1 = stream.getNextIdatByte(); byte b2 = stream.getNextIdatByte(); byte b3 = stream.getNextIdatByte(); byte b4 = stream.getNextIdatByte(); if (b1 != ~b3 || b2 != ~b4) stream.error(); uncompressedBytesRemaining = (b1 & 0xFF) | ((b2 & 0xFF) << 8); } else if (compressionType == COMPRESSED_DYNAMIC) { huffmanTables = PngHuffmanTables.getDynamicTables(stream); } else { huffmanTables = PngHuffmanTables.getFixedTables(); } }
void readNextBlockHeader() throws IOException { isLastBlock = stream.getNextIdatBit() != 0; compressionType = (byte) stream.getNextIdatBits(2); if (compressionType > 2) stream.error(); if (compressionType == UNCOMPRESSED) { byte b1 = stream.getNextIdatByte(); byte b2 = stream.getNextIdatByte(); byte b3 = stream.getNextIdatByte(); byte b4 = stream.getNextIdatByte(); if (b1 != ~b3 || b2 != ~b4) stream.error(); uncompressedBytesRemaining = (b1 & 0xFF) | ((b2 & 0xFF) << 8); } else if (compressionType == COMPRESSED_DYNAMIC) { huffmanTables = PngHuffmanTables.getDynamicTables(stream); } else { huffmanTables = PngHuffmanTables.getFixedTables(); } }
void readNextBlockHeader() throws IOException { isLastBlock = stream.getNextIdatBit() != 0; compressionType = (byte) stream.getNextIdatBits(2); if (compressionType > 2) stream.error(); if (compressionType == UNCOMPRESSED) { byte b1 = stream.getNextIdatByte(); byte b2 = stream.getNextIdatByte(); byte b3 = stream.getNextIdatByte(); byte b4 = stream.getNextIdatByte(); if (b1 != ~b3 || b2 != ~b4) stream.error(); uncompressedBytesRemaining = (b1 & 0xFF) | ((b2 & 0xFF) << 8); } else if (compressionType == COMPRESSED_DYNAMIC) { huffmanTables = PngHuffmanTables.getDynamicTables(stream); } else { huffmanTables = PngHuffmanTables.getFixedTables(); } }
void readNextBlockHeader() throws IOException { isLastBlock = stream.getNextIdatBit() != 0; compressionType = (byte) stream.getNextIdatBits(2); if (compressionType > 2) stream.error(); if (compressionType == UNCOMPRESSED) { byte b1 = stream.getNextIdatByte(); byte b2 = stream.getNextIdatByte(); byte b3 = stream.getNextIdatByte(); byte b4 = stream.getNextIdatByte(); if (b1 != ~b3 || b2 != ~b4) stream.error(); uncompressedBytesRemaining = (b1 & 0xFF) | ((b2 & 0xFF) << 8); } else if (compressionType == COMPRESSED_DYNAMIC) { huffmanTables = PngHuffmanTables.getDynamicTables(stream); } else { huffmanTables = PngHuffmanTables.getFixedTables(); } }
void readNextBlockHeader() throws IOException { isLastBlock = stream.getNextIdatBit() != 0; compressionType = (byte) stream.getNextIdatBits(2); if (compressionType > 2) stream.error(); if (compressionType == UNCOMPRESSED) { byte b1 = stream.getNextIdatByte(); byte b2 = stream.getNextIdatByte(); byte b3 = stream.getNextIdatByte(); byte b4 = stream.getNextIdatByte(); if (b1 != ~b3 || b2 != ~b4) stream.error(); uncompressedBytesRemaining = (b1 & 0xFF) | ((b2 & 0xFF) << 8); } else if (compressionType == COMPRESSED_DYNAMIC) { huffmanTables = PngHuffmanTables.getDynamicTables(stream); } else { huffmanTables = PngHuffmanTables.getFixedTables(); } }
void readNextBlockHeader() throws IOException { isLastBlock = stream.getNextIdatBit() != 0; compressionType = (byte) stream.getNextIdatBits(2); if (compressionType > 2) stream.error(); if (compressionType == UNCOMPRESSED) { byte b1 = stream.getNextIdatByte(); byte b2 = stream.getNextIdatByte(); byte b3 = stream.getNextIdatByte(); byte b4 = stream.getNextIdatByte(); if (b1 != ~b3 || b2 != ~b4) stream.error(); uncompressedBytesRemaining = (b1 & 0xFF) | ((b2 & 0xFF) << 8); } else if (compressionType == COMPRESSED_DYNAMIC) { huffmanTables = PngHuffmanTables.getDynamicTables(stream); } else { huffmanTables = PngHuffmanTables.getFixedTables(); } }