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

      • DEFAULT_BUFFERSIZE

        public static final int DEFAULT_BUFFERSIZE
        Default buffer size: 1024
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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