test_class.declarator: PARAMS1 = JreDeflateParameters.of(6, 0, true)
test_class.modifier: private static final
test_class.original_string: private static final JreDeflateParameters PARAMS1 = JreDeflateParameters.of(6, 0, true);
test_class.type: JreDeflateParameters
test_class.var_name: PARAMS1
test_class.declarator: OLD_CONTENT = "This is Content the Old"
test_class.modifier: private static final
test_class.original_string: private static final String OLD_CONTENT = "This is Content the Old";
test_class.type: String
test_class.var_name: OLD_CONTENT
test_class.declarator: OLD_ENTRY =
        new UnitTestZipEntry("/foo", PARAMS1.level, PARAMS1.nowrap, OLD_CONTENT, null)
test_class.modifier: private static final
test_class.original_string: private static final UnitTestZipEntry OLD_ENTRY =
        new UnitTestZipEntry("/foo", PARAMS1.level, PARAMS1.nowrap, OLD_CONTENT, null);
test_class.type: UnitTestZipEntry
test_class.var_name: OLD_ENTRY
test_class.declarator: NEW_CONTENT = "Rambunctious Absinthe-Loving Stegosaurus"
test_class.modifier: private static final
test_class.original_string: private static final String NEW_CONTENT = "Rambunctious Absinthe-Loving Stegosaurus";
test_class.type: String
test_class.var_name: NEW_CONTENT
test_class.declarator: NEW_ENTRY =
        new UnitTestZipEntry("/foo", PARAMS1.level, PARAMS1.nowrap, NEW_CONTENT, null)
test_class.modifier: private static final
test_class.original_string: private static final UnitTestZipEntry NEW_ENTRY =
        new UnitTestZipEntry("/foo", PARAMS1.level, PARAMS1.nowrap, NEW_CONTENT, null);
test_class.type: UnitTestZipEntry
test_class.var_name: NEW_ENTRY
test_class.declarator: UNCOMPRESSED_HEADER = new byte[] {0, 1, 2, 3, 4}
test_class.modifier: private static final
test_class.original_string: private static final byte[] UNCOMPRESSED_HEADER = new byte[] {0, 1, 2, 3, 4};
test_class.type: byte[]
test_class.var_name: UNCOMPRESSED_HEADER
test_class.declarator: UNCOMPRESSED_OLD_CONTENT = OLD_ENTRY.getUncompressedBinaryContent()
test_class.modifier: private static final
test_class.original_string: private static final byte[] UNCOMPRESSED_OLD_CONTENT = OLD_ENTRY.getUncompressedBinaryContent();
test_class.type: byte[]
test_class.var_name: UNCOMPRESSED_OLD_CONTENT
test_class.declarator: COMPRESSED_OLD_CONTENT = OLD_ENTRY.getCompressedBinaryContent()
test_class.modifier: private static final
test_class.original_string: private static final byte[] COMPRESSED_OLD_CONTENT = OLD_ENTRY.getCompressedBinaryContent();
test_class.type: byte[]
test_class.var_name: COMPRESSED_OLD_CONTENT
test_class.declarator: UNCOMPRESSED_NEW_CONTENT = NEW_ENTRY.getUncompressedBinaryContent()
test_class.modifier: private static final
test_class.original_string: private static final byte[] UNCOMPRESSED_NEW_CONTENT = NEW_ENTRY.getUncompressedBinaryContent();
test_class.type: byte[]
test_class.var_name: UNCOMPRESSED_NEW_CONTENT
test_class.declarator: COMPRESSED_NEW_CONTENT = NEW_ENTRY.getCompressedBinaryContent()
test_class.modifier: private static final
test_class.original_string: private static final byte[] COMPRESSED_NEW_CONTENT = NEW_ENTRY.getCompressedBinaryContent();
test_class.type: byte[]
test_class.var_name: COMPRESSED_NEW_CONTENT
test_class.declarator: UNCOMPRESSED_TRAILER = new byte[] {5, 6, 7, 8, 9}
test_class.modifier: private static final
test_class.original_string: private static final byte[] UNCOMPRESSED_TRAILER = new byte[] {5, 6, 7, 8, 9};
test_class.type: byte[]
test_class.var_name: UNCOMPRESSED_TRAILER
test_class.declarator: BSDIFF_DELTA = "1337 h4x0r"
test_class.modifier: private static final
test_class.original_string: private static final String BSDIFF_DELTA = "1337 h4x0r";
test_class.type: String
test_class.var_name: BSDIFF_DELTA
test_class.declarator: tempDir
test_class.modifier: private
test_class.original_string: private File tempDir;
test_class.type: File
test_class.var_name: tempDir
test_class.declarator: oldFile
test_class.modifier: private
test_class.original_string: private File oldFile;
test_class.type: File
test_class.var_name: oldFile
test_class.declarator: patchBytes
test_class.modifier: private
test_class.original_string: private byte[] patchBytes;
test_class.type: byte[]
test_class.var_name: patchBytes
test_class.declarator: expectedNewBytes
test_class.modifier: private
test_class.original_string: private byte[] expectedNewBytes;
test_class.type: byte[]
test_class.var_name: expectedNewBytes
test_class.declarator: oldFileBytes
test_class.modifier: private
test_class.original_string: private byte[] oldFileBytes;
test_class.type: byte[]
test_class.var_name: oldFileBytes
test_class.declarator: expectedDeltaFriendlyOldFileBytes
test_class.modifier: private
test_class.original_string: private byte[] expectedDeltaFriendlyOldFileBytes;
test_class.type: byte[]
test_class.var_name: expectedDeltaFriendlyOldFileBytes
test_class.declarator: fakeApplier
test_class.modifier: private
test_class.original_string: private FileByFileV1DeltaApplier fakeApplier;
test_class.type: FileByFileV1DeltaApplier
test_class.var_name: fakeApplier
test_class.file: feya/libraries/archive_diff/diff.applier/src/test/java/com/google/archivepatcher/applier/FileByFileV1DeltaApplierTest.java
test_class.identifier: FileByFileV1DeltaApplierTest
test_case.body: @Test
    public void testApplyDelta_DoesntCloseStream() throws IOException {
      // Test for https://github.com/andrewhayden/archive-patcher/issues/6
      final AtomicBoolean closed = new AtomicBoolean(false);
      ByteArrayOutputStream actualNewBlobOut = new ByteArrayOutputStream() {
        @Override
        public void close() throws IOException {
          closed.set(true);
        }
      };
      fakeApplier.applyDelta(oldFile, new ByteArrayInputStream(patchBytes), actualNewBlobOut);
      Assert.assertArrayEquals(expectedNewBytes, actualNewBlobOut.toByteArray());
      Assert.assertFalse(closed.get());
    }
test_case.class_method_signature: FileByFileV1DeltaApplierTest.testApplyDelta_DoesntCloseStream()
test_case.full_signature: @Test public void testApplyDelta_DoesntCloseStream()
test_case.identifier: testApplyDelta_DoesntCloseStream
test_case.invocations: set applyDelta assertArrayEquals toByteArray assertFalse get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testApplyDelta_DoesntCloseStream()
focal_class.declarator: DEFAULT_COPY_BUFFER_SIZE = 32768
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_COPY_BUFFER_SIZE = 32768;
focal_class.type: int
focal_class.var_name: DEFAULT_COPY_BUFFER_SIZE
focal_class.declarator: tempDir
focal_class.modifier: private final
focal_class.original_string: private final File tempDir;
focal_class.type: File
focal_class.var_name: tempDir
focal_class.file: feya/libraries/archive_diff/diff.applier/src/main/java/com/google/archivepatcher/applier/FileByFileV1DeltaApplier.java
focal_class.identifier: FileByFileV1DeltaApplier
focal_class.interfaces: implements DeltaApplier
focal_class.class_method_signature: FileByFileV1DeltaApplier.FileByFileV1DeltaApplier()
focal_class.full_signature: public  FileByFileV1DeltaApplier()
focal_class.identifier: FileByFileV1DeltaApplier
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  FileByFileV1DeltaApplier()
focal_class.class_method_signature: FileByFileV1DeltaApplier.FileByFileV1DeltaApplier(File tempDir)
focal_class.full_signature: public  FileByFileV1DeltaApplier(File tempDir)
focal_class.identifier: FileByFileV1DeltaApplier
focal_class.modifiers: public
focal_class.parameters: (File tempDir)
focal_class.signature:  FileByFileV1DeltaApplier(File tempDir)
focal_class.class_method_signature: FileByFileV1DeltaApplier.applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.full_signature: @Override public void applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.identifier: applyDelta
focal_class.modifiers: @Override public
focal_class.parameters: (File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.return: void
focal_class.signature: void applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.class_method_signature: FileByFileV1DeltaApplier.applyDeltaInternal(
        File oldBlob, File deltaFriendlyOldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.full_signature: private void applyDeltaInternal(
        File oldBlob, File deltaFriendlyOldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.identifier: applyDeltaInternal
focal_class.modifiers: private
focal_class.parameters: (
        File oldBlob, File deltaFriendlyOldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.return: void
focal_class.signature: void applyDeltaInternal(
        File oldBlob, File deltaFriendlyOldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_class.class_method_signature: FileByFileV1DeltaApplier.writeDeltaFriendlyOldBlob(
        PatchApplyPlan plan, File oldBlob, File deltaFriendlyOldBlob)
focal_class.full_signature: private void writeDeltaFriendlyOldBlob(
        PatchApplyPlan plan, File oldBlob, File deltaFriendlyOldBlob)
focal_class.identifier: writeDeltaFriendlyOldBlob
focal_class.modifiers: private
focal_class.parameters: (
        PatchApplyPlan plan, File oldBlob, File deltaFriendlyOldBlob)
focal_class.return: void
focal_class.signature: void writeDeltaFriendlyOldBlob(
        PatchApplyPlan plan, File oldBlob, File deltaFriendlyOldBlob)
focal_class.class_method_signature: FileByFileV1DeltaApplier.getDeltaApplier()
focal_class.full_signature: protected DeltaApplier getDeltaApplier()
focal_class.identifier: getDeltaApplier
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: DeltaApplier
focal_class.signature: DeltaApplier getDeltaApplier()
focal_method.body: @Override
    public void applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
        throws IOException {
      if (!tempDir.exists()) {
        // Be nice, try to create the temp directory. Don't bother to check return value as the code
        // will fail when it tries to create the file in a few more lines anyways.
        tempDir.mkdirs();
      }
      File tempFile = File.createTempFile("gfbfv1", "old", tempDir);
      try {
        applyDeltaInternal(oldBlob, tempFile, deltaIn, newBlobOut);
      } finally {
        tempFile.delete();
      }
    }
focal_method.class_method_signature: FileByFileV1DeltaApplier.applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_method.full_signature: @Override public void applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_method.identifier: applyDelta
focal_method.invocations: exists mkdirs createTempFile applyDeltaInternal delete
focal_method.modifiers: @Override public
focal_method.parameters: (File oldBlob, InputStream deltaIn, OutputStream newBlobOut)
focal_method.return: void
focal_method.signature: void applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)