private final int _handleUncompressed(byte[] comp, int offset, int end) throws IOException { // Simple, we just do pass through... int amount = Math.min(end-offset, _uncompressedLength-_bytesReadFromBlock); if (!_handler.handleData(comp, offset, amount)) { _terminated = true; } _bytesReadFromBlock += amount; return offset + amount; }
@Override public void complete() throws IOException { byte[] b = _decodeBuffer; if (b != null) { _decodeBuffer = null; _recycler.releaseDecodeBuffer(b); } Inflater i = _inflater; if (i != null) { _inflater = null; _gzipRecycler.releaseInflater(i); } // 24-May-2012, tatu: Should we call this here; or fail with exception? _handler.allDataHandled(); if (!_terminated) { if (_state != STATE_INITIAL) { if (_state >= STATE_TRAILER_INITIAL) { if (_state == STATE_BODY) { throw new GZIPException("Invalid GZIP stream: end-of-input in the middle of compressed data"); } throw new GZIPException("Invalid GZIP stream: end-of-input in the trailer (state: "+_state+")"); } throw new GZIPException("Invalid GZIP stream: end-of-input in header (state: "+_state+")"); } } }
@Override public void complete() throws IOException { byte[] b = _decodeBuffer; if (b != null) { _decodeBuffer = null; _recycler.releaseDecodeBuffer(b); } Inflater i = _inflater; if (i != null) { _inflater = null; _gzipRecycler.releaseInflater(i); } // 24-May-2012, tatu: Should we call this here; or fail with exception? _handler.allDataHandled(); if (!_terminated) { if (_state != STATE_INITIAL) { if (_state >= STATE_TRAILER_INITIAL) { if (_state == STATE_BODY) { throw new GZIPException("Invalid GZIP stream: end-of-input in the middle of compressed data"); } throw new GZIPException("Invalid GZIP stream: end-of-input in the trailer (state: "+_state+")"); } throw new GZIPException("Invalid GZIP stream: end-of-input in header (state: "+_state+")"); } } }
private final int _handleUncompressed(byte[] comp, int offset, int end) throws IOException { // Simple, we just do pass through... int amount = Math.min(end-offset, _uncompressedLength-_bytesReadFromBlock); if (!_handler.handleData(comp, offset, amount)) { _terminated = true; } _bytesReadFromBlock += amount; return offset + amount; }
@Override public void complete() throws IOException { byte[] b = _decodeBuffer; if (b != null) { _decodeBuffer = null; _recycler.releaseDecodeBuffer(b); } Inflater i = _inflater; if (i != null) { _inflater = null; _gzipRecycler.releaseInflater(i); } // 24-May-2012, tatu: Should we call this here; or fail with exception? _handler.allDataHandled(); if (!_terminated) { if (_state != STATE_INITIAL) { if (_state >= STATE_TRAILER_INITIAL) { if (_state == STATE_BODY) { throw new GZIPException("Invalid GZIP stream: end-of-input in the middle of compressed data"); } throw new GZIPException("Invalid GZIP stream: end-of-input in the trailer (state: "+_state+")"); } throw new GZIPException("Invalid GZIP stream: end-of-input in header (state: "+_state+")"); } } }
private final int _handleUncompressed(byte[] comp, int offset, int end) throws IOException { // Simple, we just do pass through... int amount = Math.min(end-offset, _uncompressedLength-_bytesReadFromBlock); if (!_handler.handleData(comp, offset, amount)) { _terminated = true; } _bytesReadFromBlock += amount; return offset + amount; }
@Override public void complete() throws IOException { byte[] b = _inputBuffer; if (b != null) { _inputBuffer = null; _recycler.releaseInputBuffer(b); } b = _decodeBuffer; if (b != null) { _decodeBuffer = null; _recycler.releaseDecodeBuffer(b); } // 24-May-2012, tatu: Should we call this here; or fail with exception? _handler.allDataHandled(); if (!_terminated) { if (_state != STATE_INITIAL) { if (_state == STATE_HEADER_COMPRESSED_BUFFERING) { throw new LZFException("Incomplete compressed LZF block; only got "+_bytesReadFromBlock +" bytes, needed "+_compressedLength); } if (_state == STATE_HEADER_UNCOMPRESSED_STREAMING) { throw new LZFException("Incomplete uncompressed LZF block; only got "+_bytesReadFromBlock +" bytes, needed "+_uncompressedLength); } throw new LZFException("Incomplete LZF block; decoding state = "+_state); } } }
private final void _uncompress(byte[] src, int srcOffset, int len) throws IOException { if (_decodeBuffer == null) { _decodeBuffer = _recycler.allocDecodeBuffer(LZFChunk.MAX_CHUNK_LEN); } _decoder.decodeChunk(src, srcOffset, _decodeBuffer, 0, _uncompressedLength); _handler.handleData(_decodeBuffer, 0, _uncompressedLength); }
@Override public void complete() throws IOException { byte[] b = _inputBuffer; if (b != null) { _inputBuffer = null; _recycler.releaseInputBuffer(b); } b = _decodeBuffer; if (b != null) { _decodeBuffer = null; _recycler.releaseDecodeBuffer(b); } // 24-May-2012, tatu: Should we call this here; or fail with exception? _handler.allDataHandled(); if (!_terminated) { if (_state != STATE_INITIAL) { if (_state == STATE_HEADER_COMPRESSED_BUFFERING) { throw new LZFException("Incomplete compressed LZF block; only got "+_bytesReadFromBlock +" bytes, needed "+_compressedLength); } if (_state == STATE_HEADER_UNCOMPRESSED_STREAMING) { throw new LZFException("Incomplete uncompressed LZF block; only got "+_bytesReadFromBlock +" bytes, needed "+_uncompressedLength); } throw new LZFException("Incomplete LZF block; decoding state = "+_state); } } }
private final void _uncompress(byte[] src, int srcOffset, int len) throws IOException { if (_decodeBuffer == null) { _decodeBuffer = _recycler.allocDecodeBuffer(LZFChunk.MAX_CHUNK_LEN); } _decoder.decodeChunk(src, srcOffset, _decodeBuffer, 0, _uncompressedLength); _handler.handleData(_decodeBuffer, 0, _uncompressedLength); }
@Override public void complete() throws IOException { byte[] b = _inputBuffer; if (b != null) { _inputBuffer = null; _recycler.releaseInputBuffer(b); } b = _decodeBuffer; if (b != null) { _decodeBuffer = null; _recycler.releaseDecodeBuffer(b); } // 24-May-2012, tatu: Should we call this here; or fail with exception? _handler.allDataHandled(); if (!_terminated) { if (_state != STATE_INITIAL) { if (_state == STATE_HEADER_COMPRESSED_BUFFERING) { throw new LZFException("Incomplete compressed LZF block; only got "+_bytesReadFromBlock +" bytes, needed "+_compressedLength); } if (_state == STATE_HEADER_UNCOMPRESSED_STREAMING) { throw new LZFException("Incomplete uncompressed LZF block; only got "+_bytesReadFromBlock +" bytes, needed "+_uncompressedLength); } throw new LZFException("Incomplete LZF block; decoding state = "+_state); } } }
private final void _uncompress(byte[] src, int srcOffset, int len) throws IOException { if (_decodeBuffer == null) { _decodeBuffer = _recycler.allocDecodeBuffer(LZFChunk.MAX_CHUNK_LEN); } _decoder.decodeChunk(src, srcOffset, _decodeBuffer, 0, _uncompressedLength); _handler.handleData(_decodeBuffer, 0, _uncompressedLength); }
if (!_handler.handleData(_decodeBuffer, 0, decoded)) { _terminated = true; return false;
if (!_handler.handleData(_decodeBuffer, 0, decoded)) { _terminated = true; return false;
if (!_handler.handleData(_decodeBuffer, 0, decoded)) { _terminated = true; return false;