Package org.apache.lucene.store
Class BufferedChecksum
- java.lang.Object
-
- org.apache.lucene.store.BufferedChecksum
-
- All Implemented Interfaces:
java.util.zip.Checksum
public class BufferedChecksum extends java.lang.Object implements java.util.zip.ChecksumWraps anotherChecksumwith an internal buffer to speed up checksum calculations.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bufferstatic intDEFAULT_BUFFERSIZEDefault buffer size: 256private java.util.zip.Checksuminprivate intupto
-
Constructor Summary
Constructors Constructor Description BufferedChecksum(java.util.zip.Checksum in)Create a new BufferedChecksum withDEFAULT_BUFFERSIZEBufferedChecksum(java.util.zip.Checksum in, int bufferSize)Create a new BufferedChecksum with the specified bufferSize
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidflush()longgetValue()voidreset()voidupdate(byte[] b, int off, int len)voidupdate(int b)
-
-
-
Field Detail
-
in
private final java.util.zip.Checksum in
-
buffer
private final byte[] buffer
-
upto
private int upto
-
DEFAULT_BUFFERSIZE
public static final int DEFAULT_BUFFERSIZE
Default buffer size: 256- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BufferedChecksum
public BufferedChecksum(java.util.zip.Checksum in)
Create a new BufferedChecksum withDEFAULT_BUFFERSIZE
-
BufferedChecksum
public BufferedChecksum(java.util.zip.Checksum in, int bufferSize)Create a new BufferedChecksum with the specified bufferSize
-
-
Method Detail
-
update
public void update(int b)
- Specified by:
updatein interfacejava.util.zip.Checksum
-
update
public void update(byte[] b, int off, int len)- Specified by:
updatein interfacejava.util.zip.Checksum
-
getValue
public long getValue()
- Specified by:
getValuein interfacejava.util.zip.Checksum
-
reset
public void reset()
- Specified by:
resetin interfacejava.util.zip.Checksum
-
flush
private void flush()
-
-