test_class.declarator: outBuffer
test_class.modifier: private
test_class.original_string: private ByteArrayOutputStream outBuffer;
test_class.type: ByteArrayOutputStream
test_class.var_name: outBuffer
test_class.declarator: stream
test_class.modifier: private
test_class.original_string: private PartiallyCompressingOutputStream stream;
test_class.type: PartiallyCompressingOutputStream
test_class.var_name: stream
test_class.declarator: PREAMBLE_BYTES = new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
test_class.modifier: private static
test_class.original_string: private static byte[] PREAMBLE_BYTES = new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
test_class.type: byte[]
test_class.var_name: PREAMBLE_BYTES
test_class.declarator: PARAMS1 = JreDeflateParameters.of(1, 0, true)
test_class.modifier: private static
test_class.original_string: private static JreDeflateParameters PARAMS1 = JreDeflateParameters.of(1, 0, true);
test_class.type: JreDeflateParameters
test_class.var_name: PARAMS1
test_class.declarator: ENTRY1 =
        UnitTestZipArchive.makeUnitTestZipEntry(
            "/foo", PARAMS1.level, PARAMS1.nowrap, "foo-level1", null)
test_class.modifier: private static
test_class.original_string: private static UnitTestZipEntry ENTRY1 =
        UnitTestZipArchive.makeUnitTestZipEntry(
            "/foo", PARAMS1.level, PARAMS1.nowrap, "foo-level1", null);
test_class.type: UnitTestZipEntry
test_class.var_name: ENTRY1
test_class.declarator: OFFSET1 = PREAMBLE_BYTES.length
test_class.modifier: private static
test_class.original_string: private static long OFFSET1 = PREAMBLE_BYTES.length;
test_class.type: long
test_class.var_name: OFFSET1
test_class.declarator: LENGTH1 = ENTRY1.getUncompressedBinaryContent().length
test_class.modifier: private static
test_class.original_string: private static long LENGTH1 = ENTRY1.getUncompressedBinaryContent().length;
test_class.type: long
test_class.var_name: LENGTH1
test_class.declarator: COMPRESS_RANGE_1 =
        new TypedRange<JreDeflateParameters>(OFFSET1, LENGTH1, PARAMS1)
test_class.modifier: private static
test_class.original_string: private static TypedRange<JreDeflateParameters> COMPRESS_RANGE_1 =
        new TypedRange<JreDeflateParameters>(OFFSET1, LENGTH1, PARAMS1);
test_class.type: TypedRange<JreDeflateParameters>
test_class.var_name: COMPRESS_RANGE_1
test_class.declarator: GAP1_BYTES = new byte[] {37}
test_class.modifier: private static
test_class.original_string: private static byte[] GAP1_BYTES = new byte[] {37};
test_class.type: byte[]
test_class.var_name: GAP1_BYTES
test_class.declarator: PARAMS2 = JreDeflateParameters.of(6, 0, false)
test_class.modifier: private static
test_class.original_string: private static JreDeflateParameters PARAMS2 = JreDeflateParameters.of(6, 0, false);
test_class.type: JreDeflateParameters
test_class.var_name: PARAMS2
test_class.declarator: ENTRY2 =
        UnitTestZipArchive.makeUnitTestZipEntry(
            "/bar", PARAMS2.level, PARAMS2.nowrap, "bar-level6", null)
test_class.modifier: private static
test_class.original_string: private static UnitTestZipEntry ENTRY2 =
        UnitTestZipArchive.makeUnitTestZipEntry(
            "/bar", PARAMS2.level, PARAMS2.nowrap, "bar-level6", null);
test_class.type: UnitTestZipEntry
test_class.var_name: ENTRY2
test_class.declarator: OFFSET2 = OFFSET1 + LENGTH1 + GAP1_BYTES.length
test_class.modifier: private static
test_class.original_string: private static long OFFSET2 = OFFSET1 + LENGTH1 + GAP1_BYTES.length;
test_class.type: long
test_class.var_name: OFFSET2
test_class.declarator: LENGTH2 = ENTRY2.getUncompressedBinaryContent().length
test_class.modifier: private static
test_class.original_string: private static long LENGTH2 = ENTRY2.getUncompressedBinaryContent().length;
test_class.type: long
test_class.var_name: LENGTH2
test_class.declarator: COMPRESS_RANGE_2 =
        new TypedRange<JreDeflateParameters>(OFFSET2, LENGTH2, PARAMS2)
test_class.modifier: private static
test_class.original_string: private static TypedRange<JreDeflateParameters> COMPRESS_RANGE_2 =
        new TypedRange<JreDeflateParameters>(OFFSET2, LENGTH2, PARAMS2);
test_class.type: TypedRange<JreDeflateParameters>
test_class.var_name: COMPRESS_RANGE_2
test_class.file: feya/libraries/archive_diff/diff.applier/src/test/java/com/google/archivepatcher/applier/PartiallyCompressingOutputStreamTest.java
test_class.identifier: PartiallyCompressingOutputStreamTest
test_case.body: @Test
    public void testWrite_MixedSequence_Thrash() throws IOException {
      // Write uncompressed data, compressed data, uncompressed data, compressed data (new params)
      // Thrash by writing one byte at a time to pound on edge-casey code
      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());
    }
test_case.class_method_signature: PartiallyCompressingOutputStreamTest.testWrite_MixedSequence_Thrash()
test_case.full_signature: @Test public void testWrite_MixedSequence_Thrash()
test_case.identifier: testWrite_MixedSequence_Thrash
test_case.invocations: asList fuse getUncompressedBinaryContent getUncompressedBinaryContent fuse getCompressedBinaryContent getCompressedBinaryContent write flush close assertArrayEquals toByteArray
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWrite_MixedSequence_Thrash()
focal_class.declarator: normalOut
focal_class.modifier: private final
focal_class.original_string: private final OutputStream normalOut;
focal_class.type: OutputStream
focal_class.var_name: normalOut
focal_class.declarator: deflater = null
focal_class.modifier: private
focal_class.original_string: private Deflater deflater = null;
focal_class.type: Deflater
focal_class.var_name: deflater
focal_class.declarator: deflaterOut = null
focal_class.modifier: private
focal_class.original_string: private DeflaterOutputStream deflaterOut = null;
focal_class.type: DeflaterOutputStream
focal_class.var_name: deflaterOut
focal_class.declarator: internalCopyBuffer = new byte[1]
focal_class.modifier: private final
focal_class.original_string: private final byte[] internalCopyBuffer = new byte[1];
focal_class.type: byte[]
focal_class.var_name: internalCopyBuffer
focal_class.declarator: compressionBufferSize
focal_class.modifier: private final
focal_class.original_string: private final int compressionBufferSize;
focal_class.type: int
focal_class.var_name: compressionBufferSize
focal_class.declarator: numBytesWritten
focal_class.modifier: private
focal_class.original_string: private long numBytesWritten;
focal_class.type: long
focal_class.var_name: numBytesWritten
focal_class.declarator: rangeIterator
focal_class.modifier: private final
focal_class.original_string: private final Iterator<TypedRange<JreDeflateParameters>> rangeIterator;
focal_class.type: Iterator<TypedRange<JreDeflateParameters>>
focal_class.var_name: rangeIterator
focal_class.declarator: nextCompressedRange = null
focal_class.modifier: private
focal_class.original_string: private TypedRange<JreDeflateParameters> nextCompressedRange = null;
focal_class.type: TypedRange<JreDeflateParameters>
focal_class.var_name: nextCompressedRange
focal_class.declarator: lastDeflateParameters = null
focal_class.modifier: private
focal_class.original_string: private JreDeflateParameters lastDeflateParameters = null;
focal_class.type: JreDeflateParameters
focal_class.var_name: lastDeflateParameters
focal_class.file: feya/libraries/archive_diff/diff.applier/src/main/java/com/google/archivepatcher/applier/PartiallyCompressingOutputStream.java
focal_class.identifier: PartiallyCompressingOutputStream
focal_class.class_method_signature: PartiallyCompressingOutputStream.PartiallyCompressingOutputStream(
        List<TypedRange<JreDeflateParameters>> compressionRanges,
        OutputStream out,
        int compressionBufferSize)
focal_class.full_signature: public  PartiallyCompressingOutputStream(
        List<TypedRange<JreDeflateParameters>> compressionRanges,
        OutputStream out,
        int compressionBufferSize)
focal_class.identifier: PartiallyCompressingOutputStream
focal_class.modifiers: public
focal_class.parameters: (
        List<TypedRange<JreDeflateParameters>> compressionRanges,
        OutputStream out,
        int compressionBufferSize)
focal_class.signature:  PartiallyCompressingOutputStream(
        List<TypedRange<JreDeflateParameters>> compressionRanges,
        OutputStream out,
        int compressionBufferSize)
focal_class.class_method_signature: PartiallyCompressingOutputStream.write(int b)
focal_class.full_signature: @Override public void write(int b)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (int b)
focal_class.return: void
focal_class.signature: void write(int b)
focal_class.class_method_signature: PartiallyCompressingOutputStream.write(byte[] buffer)
focal_class.full_signature: @Override public void write(byte[] buffer)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] buffer)
focal_class.return: void
focal_class.signature: void write(byte[] buffer)
focal_class.class_method_signature: PartiallyCompressingOutputStream.write(byte[] buffer, int offset, int length)
focal_class.full_signature: @Override public void write(byte[] buffer, int offset, int length)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] buffer, int offset, int length)
focal_class.return: void
focal_class.signature: void write(byte[] buffer, int offset, int length)
focal_class.class_method_signature: PartiallyCompressingOutputStream.writeChunk(byte[] buffer, int offset, int length)
focal_class.full_signature: private int writeChunk(byte[] buffer, int offset, int length)
focal_class.identifier: writeChunk
focal_class.modifiers: private
focal_class.parameters: (byte[] buffer, int offset, int length)
focal_class.return: int
focal_class.signature: int writeChunk(byte[] buffer, int offset, int length)
focal_class.class_method_signature: PartiallyCompressingOutputStream.currentlyCompressing()
focal_class.full_signature: private boolean currentlyCompressing()
focal_class.identifier: currentlyCompressing
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean currentlyCompressing()
focal_class.class_method_signature: PartiallyCompressingOutputStream.bytesTillCompressionStarts()
focal_class.full_signature: private long bytesTillCompressionStarts()
focal_class.identifier: bytesTillCompressionStarts
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long bytesTillCompressionStarts()
focal_class.class_method_signature: PartiallyCompressingOutputStream.bytesTillCompressionEnds()
focal_class.full_signature: private long bytesTillCompressionEnds()
focal_class.identifier: bytesTillCompressionEnds
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long bytesTillCompressionEnds()
focal_class.superclass: extends FilterOutputStream
focal_method.body: @Override
    public void write(int b) throws IOException {
      internalCopyBuffer[0] = (byte) b;
      write(internalCopyBuffer, 0, 1);
    }
focal_method.class_method_signature: PartiallyCompressingOutputStream.write(int b)
focal_method.full_signature: @Override public void write(int b)
focal_method.identifier: write
focal_method.invocations: write
focal_method.modifiers: @Override public
focal_method.parameters: (int b)
focal_method.return: void
focal_method.signature: void write(int b)