test_class.declarator: SIGNATURE = "ENDSLEY/BSDIFF43"
test_class.modifier: private static final
test_class.original_string: private static final String SIGNATURE = "ENDSLEY/BSDIFF43";
test_class.type: String
test_class.var_name: SIGNATURE
test_class.declarator: buffer1
test_class.modifier: private
test_class.original_string: private byte[] buffer1;
test_class.type: byte[]
test_class.var_name: buffer1
test_class.declarator: buffer2
test_class.modifier: private
test_class.original_string: private byte[] buffer2;
test_class.type: byte[]
test_class.var_name: buffer2
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.file: feya/libraries/archive_diff/diff.applier/src/test/java/com/google/archivepatcher/applier/bsdiff/BsPatchTest.java
test_class.identifier: BsPatchTest
test_case.body: @Test
    public void testReadBsdiffLong() throws Exception {
      byte[] data = {
        (byte) 0x78,
        (byte) 0x56,
        (byte) 0x34,
        (byte) 0x12,
        (byte) 0,
        (byte) 0,
        (byte) 0,
        (byte) 0,
        (byte) 0xef,
        (byte) 0xbe,
        (byte) 0xad,
        (byte) 0x0e,
        (byte) 0,
        (byte) 0,
        (byte) 0,
        (byte) 0
      };
      ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
      long actual = BsPatch.readBsdiffLong(inputStream);
      Assert.assertEquals(0x12345678, actual);
      actual = BsPatch.readBsdiffLong(inputStream);
      Assert.assertEquals(0x0eadbeef, actual);
    }
test_case.class_method_signature: BsPatchTest.testReadBsdiffLong()
test_case.full_signature: @Test public void testReadBsdiffLong()
test_case.identifier: testReadBsdiffLong
test_case.invocations: readBsdiffLong assertEquals readBsdiffLong assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReadBsdiffLong()
focal_class.declarator: SIGNATURE = "ENDSLEY/BSDIFF43"
focal_class.modifier: private static final
focal_class.original_string: private static final String SIGNATURE = "ENDSLEY/BSDIFF43";
focal_class.type: String
focal_class.var_name: SIGNATURE
focal_class.declarator: PATCH_BUFFER_SIZE = 1024 * 50
focal_class.modifier: private static final
focal_class.original_string: private static final int PATCH_BUFFER_SIZE = 1024 * 50;
focal_class.type: int
focal_class.var_name: PATCH_BUFFER_SIZE
focal_class.declarator: NEGATIVE_LONG_SIGN_MASK = 1L << 63
focal_class.modifier: private static final
focal_class.original_string: private static final long NEGATIVE_LONG_SIGN_MASK = 1L << 63;
focal_class.type: long
focal_class.var_name: NEGATIVE_LONG_SIGN_MASK
focal_class.declarator: PATCH_STREAM_BUFFER_SIZE = 4 * 1024
focal_class.modifier: private static final
focal_class.original_string: private static final int PATCH_STREAM_BUFFER_SIZE = 4 * 1024;
focal_class.type: int
focal_class.var_name: PATCH_STREAM_BUFFER_SIZE
focal_class.declarator: OUTPUT_STREAM_BUFFER_SIZE = 16 * 1024
focal_class.modifier: private static final
focal_class.original_string: private static final int OUTPUT_STREAM_BUFFER_SIZE = 16 * 1024;
focal_class.type: int
focal_class.var_name: OUTPUT_STREAM_BUFFER_SIZE
focal_class.file: feya/libraries/archive_diff/diff.applier/src/main/java/com/google/archivepatcher/applier/bsdiff/BsPatch.java
focal_class.identifier: BsPatch
focal_class.class_method_signature: BsPatch.applyPatch(
        RandomAccessFile oldData, OutputStream newData, InputStream patchData)
focal_class.full_signature: public static void applyPatch(
        RandomAccessFile oldData, OutputStream newData, InputStream patchData)
focal_class.identifier: applyPatch
focal_class.modifiers: public static
focal_class.parameters: (
        RandomAccessFile oldData, OutputStream newData, InputStream patchData)
focal_class.return: void
focal_class.signature: void applyPatch(
        RandomAccessFile oldData, OutputStream newData, InputStream patchData)
focal_class.class_method_signature: BsPatch.applyPatchInternal(
        final RandomAccessFile oldData,
        final OutputStream newData,
        final InputStream patchData)
focal_class.full_signature: private static void applyPatchInternal(
        final RandomAccessFile oldData,
        final OutputStream newData,
        final InputStream patchData)
focal_class.identifier: applyPatchInternal
focal_class.modifiers: private static
focal_class.parameters: (
        final RandomAccessFile oldData,
        final OutputStream newData,
        final InputStream patchData)
focal_class.return: void
focal_class.signature: void applyPatchInternal(
        final RandomAccessFile oldData,
        final OutputStream newData,
        final InputStream patchData)
focal_class.class_method_signature: BsPatch.transformBytes(
        final int diffLength,
        final InputStream patchData,
        final RandomAccessFile oldData,
        final OutputStream newData,
        final byte[] buffer1,
        final byte[] buffer2)
focal_class.full_signature: static void transformBytes(
        final int diffLength,
        final InputStream patchData,
        final RandomAccessFile oldData,
        final OutputStream newData,
        final byte[] buffer1,
        final byte[] buffer2)
focal_class.identifier: transformBytes
focal_class.modifiers: static
focal_class.parameters: (
        final int diffLength,
        final InputStream patchData,
        final RandomAccessFile oldData,
        final OutputStream newData,
        final byte[] buffer1,
        final byte[] buffer2)
focal_class.return: void
focal_class.signature: void transformBytes(
        final int diffLength,
        final InputStream patchData,
        final RandomAccessFile oldData,
        final OutputStream newData,
        final byte[] buffer1,
        final byte[] buffer2)
focal_class.class_method_signature: BsPatch.readBsdiffLong(InputStream in)
focal_class.full_signature: static final long readBsdiffLong(InputStream in)
focal_class.identifier: readBsdiffLong
focal_class.modifiers: static final
focal_class.parameters: (InputStream in)
focal_class.return: long
focal_class.signature: long readBsdiffLong(InputStream in)
focal_class.class_method_signature: BsPatch.readFully(
        final InputStream in, final byte[] destination, final int startAt, final int numBytes)
focal_class.full_signature: static void readFully(
        final InputStream in, final byte[] destination, final int startAt, final int numBytes)
focal_class.identifier: readFully
focal_class.modifiers: static
focal_class.parameters: (
        final InputStream in, final byte[] destination, final int startAt, final int numBytes)
focal_class.return: void
focal_class.signature: void readFully(
        final InputStream in, final byte[] destination, final int startAt, final int numBytes)
focal_class.class_method_signature: BsPatch.pipe(
        final InputStream in, final OutputStream out, final byte[] buffer, int copyLength)
focal_class.full_signature: static void pipe(
        final InputStream in, final OutputStream out, final byte[] buffer, int copyLength)
focal_class.identifier: pipe
focal_class.modifiers: static
focal_class.parameters: (
        final InputStream in, final OutputStream out, final byte[] buffer, int copyLength)
focal_class.return: void
focal_class.signature: void pipe(
        final InputStream in, final OutputStream out, final byte[] buffer, int copyLength)
focal_method.body: static final long readBsdiffLong(InputStream in) throws PatchFormatException, IOException {
      long result = 0;
      for (int bitshift = 0; bitshift < 64; bitshift += 8) {
        result |= ((long) in.read()) << bitshift;
      }
  
      if (result == NEGATIVE_LONG_SIGN_MASK) {
        // "Negative zero", which is valid in signed-magnitude format.
        // NB: No sane patch generator should ever produce such a value.
        throw new PatchFormatException("read negative zero");
      }
  
      if ((result & NEGATIVE_LONG_SIGN_MASK) != 0) {
        result = -(result & ~NEGATIVE_LONG_SIGN_MASK);
      }
  
      return result;
    }
focal_method.class_method_signature: BsPatch.readBsdiffLong(InputStream in)
focal_method.full_signature: static final long readBsdiffLong(InputStream in)
focal_method.identifier: readBsdiffLong
focal_method.invocations: read
focal_method.modifiers: static final
focal_method.parameters: (InputStream in)
focal_method.return: long
focal_method.signature: long readBsdiffLong(InputStream in)