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 and Description
    --- | ---
    `static int` | `DEFAULT_BUFFERSIZE` Default buffer size: 256

  - ### Constructor Summary

    Constructors
    Constructor and 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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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`

- - ### Field Detail

    - #### DEFAULT_BUFFERSIZE

          public static final int DEFAULT_BUFFERSIZE

      Default buffer size: 256
      See Also:
        Constant Field Values

  - ### Constructor Detail

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

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

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.