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 PartiallyUncompressingPipe stream;
test_class.type: PartiallyUncompressingPipe
test_class.var_name: stream
test_class.file: feya/libraries/archive_diff/diff.shared/src/test/java/com/google/archivepatcher/shared/PartiallyUncompressingPipeTest.java
test_class.identifier: PartiallyUncompressingPipeTest
test_case.body: @Test
    public void testWriteAll_Multiple() throws IOException {
      // A series of uncompressed, compressed, uncompressed, compressed, uncompressed bytes.
      UnitTestZipEntry entryA =
          UnitTestZipArchive.makeUnitTestZipEntry("/bar", 3, "dragon lance", null);
      UnitTestZipEntry entryB =
          UnitTestZipArchive.makeUnitTestZipEntry("/baz", 8, "kender & hoopak", null);
      ByteArrayOutputStream expected = new ByteArrayOutputStream();
  
      // Write everything
      byte[] expectedBytes1 = new byte[] {1, 2, 3, 4, 5};
      expected.write(expectedBytes1);
      stream.pipe(new ByteArrayInputStream(expectedBytes1), Mode.COPY);
  
      stream.pipe(
          new ByteArrayInputStream(entryA.getCompressedBinaryContent()), Mode.UNCOMPRESS_NOWRAP);
      expected.write(entryA.getUncompressedBinaryContent());
  
      byte[] expectedBytes3 = new byte[] {6, 7, 8, 9, 0};
      stream.pipe(new ByteArrayInputStream(expectedBytes3), Mode.COPY);
      expected.write(expectedBytes3);
  
      stream.pipe(
          new ByteArrayInputStream(entryB.getCompressedBinaryContent()), Mode.UNCOMPRESS_NOWRAP);
      expected.write(entryB.getUncompressedBinaryContent());
  
      byte[] expectedBytes5 = new byte[] {127, 127, 127, 127, 127, 127};
      stream.pipe(new ByteArrayInputStream(expectedBytes5), Mode.COPY);
      expected.write(expectedBytes5);
  
      Assert.assertArrayEquals(expected.toByteArray(), outBuffer.toByteArray());
    }
test_case.class_method_signature: PartiallyUncompressingPipeTest.testWriteAll_Multiple()
test_case.full_signature: @Test public void testWriteAll_Multiple()
test_case.identifier: testWriteAll_Multiple
test_case.invocations: makeUnitTestZipEntry makeUnitTestZipEntry write pipe pipe getCompressedBinaryContent write getUncompressedBinaryContent pipe write pipe getCompressedBinaryContent write getUncompressedBinaryContent pipe write assertArrayEquals toByteArray toByteArray
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWriteAll_Multiple()
focal_class.declarator: uncompressor
focal_class.modifier: private final
focal_class.original_string: private final DeflateUncompressor uncompressor;
focal_class.type: DeflateUncompressor
focal_class.var_name: uncompressor
focal_class.declarator: out
focal_class.modifier: private final
focal_class.original_string: private final CountingOutputStream out;
focal_class.type: CountingOutputStream
focal_class.var_name: out
focal_class.declarator: copyBuffer
focal_class.modifier: private final
focal_class.original_string: private final byte[] copyBuffer;
focal_class.type: byte[]
focal_class.var_name: copyBuffer
focal_class.file: feya/libraries/archive_diff/diff.shared/src/main/java/com/google/archivepatcher/shared/PartiallyUncompressingPipe.java
focal_class.identifier: PartiallyUncompressingPipe
focal_class.interfaces: implements Closeable
focal_class.class_method_signature: PartiallyUncompressingPipe.PartiallyUncompressingPipe(OutputStream out, int copyBufferSize)
focal_class.full_signature: public  PartiallyUncompressingPipe(OutputStream out, int copyBufferSize)
focal_class.identifier: PartiallyUncompressingPipe
focal_class.modifiers: public
focal_class.parameters: (OutputStream out, int copyBufferSize)
focal_class.signature:  PartiallyUncompressingPipe(OutputStream out, int copyBufferSize)
focal_class.class_method_signature: PartiallyUncompressingPipe.pipe(InputStream in, Mode mode)
focal_class.full_signature: public long pipe(InputStream in, Mode mode)
focal_class.identifier: pipe
focal_class.modifiers: public
focal_class.parameters: (InputStream in, Mode mode)
focal_class.return: long
focal_class.signature: long pipe(InputStream in, Mode mode)
focal_class.class_method_signature: PartiallyUncompressingPipe.getNumBytesWritten()
focal_class.full_signature: public long getNumBytesWritten()
focal_class.identifier: getNumBytesWritten
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getNumBytesWritten()
focal_class.class_method_signature: PartiallyUncompressingPipe.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: public long pipe(InputStream in, Mode mode) throws IOException {
      long bytesWrittenBefore = out.getNumBytesWritten();
      if (mode == Mode.COPY) {
        int numRead = 0;
        while ((numRead = in.read(copyBuffer)) >= 0) {
          out.write(copyBuffer, 0, numRead);
        }
      } else {
        uncompressor.setNowrap(mode == Mode.UNCOMPRESS_NOWRAP);
        uncompressor.uncompress(in, out);
      }
      out.flush();
      return out.getNumBytesWritten() - bytesWrittenBefore;
    }
focal_method.class_method_signature: PartiallyUncompressingPipe.pipe(InputStream in, Mode mode)
focal_method.full_signature: public long pipe(InputStream in, Mode mode)
focal_method.identifier: pipe
focal_method.invocations: getNumBytesWritten read write setNowrap uncompress flush getNumBytesWritten
focal_method.modifiers: public
focal_method.parameters: (InputStream in, Mode mode)
focal_method.return: long
focal_method.signature: long pipe(InputStream in, Mode mode)