DeflateUncompressor implements Uncompressor { @Override public void uncompress(InputStream compressedIn, OutputStream uncompressedOut) throws IOException { InflaterInputStream inflaterIn = new InflaterInputStream(compressedIn, createOrResetInflater(), inputBufferSize); byte[] buffer = new byte[outputBufferSize]; int numRead = 0; while ((numRead = inflaterIn.read(buffer)) >= 0) { uncompressedOut.write(buffer, 0, numRead); } if (!isCaching()) { release(); } }  boolean isNowrap(); int getInputBufferSize(); void setInputBufferSize(int inputBufferSize); int getOutputBufferSize(); void setOutputBufferSize(int outputBufferSize); void setNowrap(boolean nowrap); boolean isCaching(); void setCaching(boolean caching); void release(); @Override void uncompress(InputStream compressedIn, OutputStream uncompressedOut);  }
@Test public void testUncompress() throws IOException { uncompressor.uncompress(compressedContentIn, uncompressedContentOut); assertTrue(Arrays.equals(CONTENT, uncompressedContentOut.toByteArray())); }