@Override protected void onRemoval(Inflater inflater) throws Exception { inflater.end(); } };
/** * Calls {@link Inflater#end()} to free acquired memory to prevent OutOfMemory error. * However, does NOT close underlying InputStream. * * @throws java.io.IOException for any issues closing underlying stream */ @Override public void close() throws IOException { inflater.end(); } }
@Override protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception { super.handlerRemoved0(ctx); if (inflater != null) { inflater.end(); } }
@Override public void dispose() { // Call end so that native zlib resources can be immediately released rather than relying on finalizer compress.end(); decompress.end(); } }
/** {@inheritDoc} */ @Override public void close() throws IOException { try { in.close(); } finally { inflater.end(); } }
@Override public void close() throws IOException { if (!closed) { closed = true; try { in.close(); } finally { inf.end(); } } }
@Override public void close() throws IOException { if (closed) return; inflater.end(); closed = true; source.close(); } }
@Override protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception { super.handlerRemoved0(ctx); if (inflater != null) { inflater.end(); } }
@Override protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception { super.handlerRemoved0(ctx); if (inflater != null) { inflater.end(); } }
public void terminateReads() throws IOException { inflater.end(); next.terminateReads(); }
@Override public void close() throws IOException { super.close(); inflater.end(); } };
@Override public void close() throws IOException { try { inflaterInputStream.close(); } finally { inflater.end(); } } }
@Override public void close() throws IOException { try { super.close(); } finally { inflater.end(); } } };
@Override public void close() throws IOException { super.close(); inflater.end(); } };
@Override public void close() throws IOException { super.close(); inflater.end(); } };
/** * Writes remaining data into the output stream and closes the underlying * output stream. */ @Override public void close() throws IOException { if (!closed) { finish(); inf.end(); out.close(); closed = true; } }
@Override protected void finalize() { try { if (guard != null) { guard.warnIfOpen(); } end(); } finally { try { super.finalize(); } catch (Throwable t) { throw new AssertionError(t); } } }
@Override public void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen) { Inflater decompresser = new Inflater(); decompresser.setInput(in, inPos, inLen); decompresser.finished(); try { int len = decompresser.inflate(out, outPos, outLen); if (len != outLen) { throw new DataFormatException(len + " " + outLen); } } catch (DataFormatException e) { throw DbException.get(ErrorCode.COMPRESSION_ERROR, e); } decompresser.end(); }
@Override public void end() { super.end(); releaseBuffer(); decompressor.end(); }
private static @Nullable ArrayList<Mesh> parseMshp(ParsableByteArray input) { int version = input.readUnsignedByte(); if (version != 0) { return null; } input.skipBytes(7); // flags + crc. int encoding = input.readInt(); if (encoding == TYPE_DFL8) { ParsableByteArray output = new ParsableByteArray(); Inflater inflater = new Inflater(true); try { if (!Util.inflate(input, output, inflater)) { return null; } } finally { inflater.end(); } input = output; } else if (encoding != TYPE_RAW) { return null; } return parseRawMshpData(input); }