@Test public void testReadBsdiffLong_Zero() throws Exception { long expected = 0x00000000L; long actual = BsPatch.readBsdiffLong( new ByteArrayInputStream( new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 })); Assert.assertEquals(expected, actual); }
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) { throw new PatchFormatException("read negative zero"); } if ((result & NEGATIVE_LONG_SIGN_MASK) != 0) { result = -(result & ~NEGATIVE_LONG_SIGN_MASK); } return result; }
BsPatch { 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) { throw new PatchFormatException("read negative zero"); } if ((result & NEGATIVE_LONG_SIGN_MASK) != 0) { result = -(result & ~NEGATIVE_LONG_SIGN_MASK); } return result; } }
BsPatch { 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) { throw new PatchFormatException("read negative zero"); } if ((result & NEGATIVE_LONG_SIGN_MASK) != 0) { result = -(result & ~NEGATIVE_LONG_SIGN_MASK); } return result; }  }
BsPatch { 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) { throw new PatchFormatException("read negative zero"); } if ((result & NEGATIVE_LONG_SIGN_MASK) != 0) { result = -(result & ~NEGATIVE_LONG_SIGN_MASK); } return result; }  static void applyPatch(
      RandomAccessFile oldData, OutputStream newData, InputStream patchData); }
BsPatch { 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) { throw new PatchFormatException("read negative zero"); } if ((result & NEGATIVE_LONG_SIGN_MASK) != 0) { result = -(result & ~NEGATIVE_LONG_SIGN_MASK); } return result; }  static void applyPatch(
      RandomAccessFile oldData, OutputStream newData, InputStream patchData);  }