Class Crc32

java.lang.Object
org.agrona.checksum.Crc32
All Implemented Interfaces:
Checksum

public final class Crc32 extends Object implements Checksum
Implementation of the Checksum interface that computes CRC-32 checksum.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Crc32
    Singleton instance to compute CRC-32 checksum.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compute(long address, int offset, int length)
    Computes a checksum based on the contents of a java.nio.DirectByteBuffer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INSTANCE

      public static final Crc32 INSTANCE
      Singleton instance to compute CRC-32 checksum.
  • Method Details

    • compute

      public int compute(long address, int offset, int length)
      Computes a checksum based on the contents of a java.nio.DirectByteBuffer.
      Specified by:
      compute in interface Checksum
      Parameters:
      address - of the buffer.
      offset - within the buffer to begin at.
      length - of the data to read.
      Returns:
      computed checksum value.