Class BufferedChecksum

java.lang.Object
org.apache.lucene.store.BufferedChecksum
All Implemented Interfaces:
Checksum

public class BufferedChecksum extends Object implements Checksum
Wraps another Checksum with an internal buffer to speed up checksum calculations.
  • Field Details

    • in

      private final Checksum in
    • buffer

      private final byte[] buffer
    • upto

      private int upto
    • DEFAULT_BUFFERSIZE

      public static final int DEFAULT_BUFFERSIZE
      Default buffer size: 1024
      See Also:
  • Constructor Details

    • BufferedChecksum

      public BufferedChecksum(Checksum in)
      Create a new BufferedChecksum with DEFAULT_BUFFERSIZE
    • BufferedChecksum

      public BufferedChecksum(Checksum in, int bufferSize)
      Create a new BufferedChecksum with the specified bufferSize
  • Method Details

    • update

      public void update(int b)
      Specified by:
      update in interface Checksum
    • update

      public void update(byte[] b, int off, int len)
      Specified by:
      update in interface Checksum
    • updateShort

      void updateShort(short val)
    • updateInt

      void updateInt(int val)
    • updateLong

      void updateLong(long val)
    • updateLongs

      void updateLongs(long[] vals, int offset, int len)
    • getValue

      public long getValue()
      Specified by:
      getValue in interface Checksum
    • reset

      public void reset()
      Specified by:
      reset in interface Checksum
    • flush

      private void flush()