@Test public void testWrite_MixedSequence_Thrash() throws IOException { stream = new PartiallyCompressingOutputStream( Arrays.asList(COMPRESS_RANGE_1, COMPRESS_RANGE_2), outBuffer, 32768); byte[] input = fuse( PREAMBLE_BYTES, ENTRY1.getUncompressedBinaryContent(), GAP1_BYTES, ENTRY2.getUncompressedBinaryContent()); byte[] expected = fuse( PREAMBLE_BYTES, ENTRY1.getCompressedBinaryContent(), GAP1_BYTES, ENTRY2.getCompressedBinaryContent()); for (int x = 0; x < input.length; x++) { stream.write(input[x] & 0xff); stream.flush(); } stream.close(); Assert.assertArrayEquals(expected, outBuffer.toByteArray()); }
@Override public void write(int b) throws IOException { internalCopyBuffer[0] = (byte) b; write(internalCopyBuffer, 0, 1); }
PartiallyCompressingOutputStream extends FilterOutputStream { @Override public void write(int b) throws IOException { internalCopyBuffer[0] = (byte) b; write(internalCopyBuffer, 0, 1); } }
PartiallyCompressingOutputStream extends FilterOutputStream { @Override public void write(int b) throws IOException { internalCopyBuffer[0] = (byte) b; write(internalCopyBuffer, 0, 1); } PartiallyCompressingOutputStream(
      List<TypedRange<JreDeflateParameters>> compressionRanges,
      OutputStream out,
      int compressionBufferSize); }
PartiallyCompressingOutputStream extends FilterOutputStream { @Override public void write(int b) throws IOException { internalCopyBuffer[0] = (byte) b; write(internalCopyBuffer, 0, 1); } PartiallyCompressingOutputStream(
      List<TypedRange<JreDeflateParameters>> compressionRanges,
      OutputStream out,
      int compressionBufferSize); @Override void write(int b); @Override void write(byte[] buffer); @Override void write(byte[] buffer, int offset, int length); }
PartiallyCompressingOutputStream extends FilterOutputStream { @Override public void write(int b) throws IOException { internalCopyBuffer[0] = (byte) b; write(internalCopyBuffer, 0, 1); } PartiallyCompressingOutputStream(
      List<TypedRange<JreDeflateParameters>> compressionRanges,
      OutputStream out,
      int compressionBufferSize); @Override void write(int b); @Override void write(byte[] buffer); @Override void write(byte[] buffer, int offset, int length);  }