BufferedChecksum (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.store, class: BufferedChecksum

Package org.apache.lucene.store

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_BUFFERSIZE`
  Default buffer size: 1024

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BufferedChecksum(Checksum in)`
  Create a new BufferedChecksum with `DEFAULT_BUFFERSIZE`
  `BufferedChecksum(Checksum in, int bufferSize)`
  Create a new BufferedChecksum with the specified bufferSize

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getValue()`
  `void`
  `reset()`
  `void`
  `update(byte[] b, int off, int len)`
  `void`
  `update(int b)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.zip.Checksum

  `update, update`

- ## Field Details

  - ### DEFAULT_BUFFERSIZE

    public static final int DEFAULT_BUFFERSIZE
    Default buffer size: 1024
    See Also:
      - Constant Field Values

- ## 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`

  - ### getValue

    public long getValue()
    Specified by:
      `getValue` in interface `Checksum`

  - ### reset

    public void reset()
    Specified by:
      `reset` in interface `Checksum`