NativeCrc32 { @Deprecated @VisibleForTesting static native void nativeVerifyChunkedSums( int bytesPerSum, int checksumType, ByteBuffer sums, int sumsOffset, ByteBuffer data, int dataOffset, int dataLength, String fileName, long basePos) throws ChecksumException;  static boolean isAvailable(); static void verifyChunkedSums(int bytesPerSum, int checksumType,
      ByteBuffer sums, ByteBuffer data, String fileName, long basePos); static void verifyChunkedSumsByteArray(int bytesPerSum,
      int checksumType, byte[] sums, int sumsOffset, byte[] data,
      int dataOffset, int dataLength, String fileName, long basePos); static void calculateChunkedSums(int bytesPerSum, int checksumType,
      ByteBuffer sums, ByteBuffer data); static void calculateChunkedSumsByteArray(int bytesPerSum,
      int checksumType, byte[] sums, int sumsOffset, byte[] data,
      int dataOffset, int dataLength); static final int CHECKSUM_CRC32; static final int CHECKSUM_CRC32C; }
@Test @SuppressWarnings("deprecation") public void testNativeVerifyChunkedSumsSuccess() throws ChecksumException { allocateDirectByteBuffers(); fillDataAndValidChecksums(); NativeCrc32.nativeVerifyChunkedSums(bytesPerChecksum, checksumType.id, checksums, checksums.position(), data, data.position(), data.remaining(), fileName, BASE_POSITION); }
@Test @SuppressWarnings("deprecation") public void testNativeVerifyChunkedSumsFail() throws ChecksumException { allocateDirectByteBuffers(); fillDataAndInvalidChecksums(); exception.expect(ChecksumException.class); NativeCrc32.nativeVerifyChunkedSums(bytesPerChecksum, checksumType.id, checksums, checksums.position(), data, data.position(), data.remaining(), fileName, BASE_POSITION); }