test_class.file: feya/libraries/archive_diff/diff.generator/src/test/java/com/google/archivepatcher/generator/bsdiff/BsUtilTest.java
test_class.identifier: BsUtilTest
test_case.body: @Test
    public void lexicographicalCompareTest() throws IOException {
      String s1 = "this is a string";
      String s2 = "that was a string";
      byte[] s1b = s1.getBytes(Charset.forName("US-ASCII"));
      byte[] s2b = s2.getBytes(Charset.forName("US-ASCII"));
      RandomAccessObject s1ro = new RandomAccessObject.RandomAccessByteArrayObject(s1b);
      RandomAccessObject s2ro = new RandomAccessObject.RandomAccessByteArrayObject(s2b);
  
      int r = BsUtil.lexicographicalCompare(s1ro, 0, s1b.length, s2ro, 0, s2b.length);
      Assert.assertTrue(r > 0);
  
      r = BsUtil.lexicographicalCompare(s1ro, 5, s1b.length - 5, s2ro, 5, s2b.length - 5);
      Assert.assertTrue(r < 0);
  
      r = BsUtil.lexicographicalCompare(s1ro, 7, s1b.length - 7, s2ro, 8, s2b.length - 7);
      Assert.assertTrue(r < 0);
  
      r = BsUtil.lexicographicalCompare(s1ro, 7, s1b.length - 8, s2ro, 8, s2b.length - 8);
      Assert.assertTrue(r < 0);
  
      r = BsUtil.lexicographicalCompare(s1ro, 0, 2, s2ro, 0, 2);
      Assert.assertEquals(0, r);
  
      r = BsUtil.lexicographicalCompare(s1ro, 0, 1, s2ro, 0, 2);
      Assert.assertTrue(r < 0);
  
      r = BsUtil.lexicographicalCompare(s1ro, 0, 2, s2ro, 0, 1);
      Assert.assertTrue(r > 0);
    }
test_case.class_method_signature: BsUtilTest.lexicographicalCompareTest()
test_case.full_signature: @Test public void lexicographicalCompareTest()
test_case.identifier: lexicographicalCompareTest
test_case.invocations: getBytes forName getBytes forName lexicographicalCompare assertTrue lexicographicalCompare assertTrue lexicographicalCompare assertTrue lexicographicalCompare assertTrue lexicographicalCompare assertEquals lexicographicalCompare assertTrue lexicographicalCompare assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void lexicographicalCompareTest()
focal_class.declarator: NEGATIVE_MASK = 1L << 63
focal_class.modifier: private static final
focal_class.original_string: private static final long NEGATIVE_MASK = 1L << 63;
focal_class.type: long
focal_class.var_name: NEGATIVE_MASK
focal_class.file: feya/libraries/archive_diff/diff.generator/src/main/java/com/google/archivepatcher/generator/bsdiff/BsUtil.java
focal_class.identifier: BsUtil
focal_class.class_method_signature: BsUtil.writeFormattedLong(final long value, OutputStream outputStream)
focal_class.full_signature: static void writeFormattedLong(final long value, OutputStream outputStream)
focal_class.identifier: writeFormattedLong
focal_class.modifiers: static
focal_class.parameters: (final long value, OutputStream outputStream)
focal_class.return: void
focal_class.signature: void writeFormattedLong(final long value, OutputStream outputStream)
focal_class.class_method_signature: BsUtil.readFormattedLong(InputStream inputStream)
focal_class.full_signature: static long readFormattedLong(InputStream inputStream)
focal_class.identifier: readFormattedLong
focal_class.modifiers: static
focal_class.parameters: (InputStream inputStream)
focal_class.return: long
focal_class.signature: long readFormattedLong(InputStream inputStream)
focal_class.class_method_signature: BsUtil.lexicographicalCompare(
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
focal_class.full_signature: static int lexicographicalCompare(
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
focal_class.identifier: lexicographicalCompare
focal_class.modifiers: static
focal_class.parameters: (
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
focal_class.return: int
focal_class.signature: int lexicographicalCompare(
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
focal_method.body: static int lexicographicalCompare(
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
        throws IOException {
      int bytesLeft = Math.min(length1, length2);
  
      data1.seek(start1);
      data2.seek(start2);
      while (bytesLeft-- > 0) {
        final int i1 = data1.readUnsignedByte();
        final int i2 = data2.readUnsignedByte();
  
        if (i1 != i2) {
          return i1 - i2;
        }
      }
  
      return length1 - length2;
    }
focal_method.class_method_signature: BsUtil.lexicographicalCompare(
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
focal_method.full_signature: static int lexicographicalCompare(
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
focal_method.identifier: lexicographicalCompare
focal_method.invocations: min seek seek readUnsignedByte readUnsignedByte
focal_method.modifiers: static
focal_method.parameters: (
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)
focal_method.return: int
focal_method.signature: int lexicographicalCompare(
        final RandomAccessObject data1,
        final int start1,
        final int length1,
        final RandomAccessObject data2,
        final int start2,
        final int length2)