public class ChecksumUtility extends Object
Adler32
checksum of a buffer. This
class is NOT thread-safe.Modifier and Type | Field and Description |
---|---|
protected Adler32 |
chk
Used to compute the checksums.
|
static ThreadLocal<ChecksumUtility> |
threadChk
ThreadLocal
ChecksumUtility factory. |
Constructor and Description |
---|
ChecksumUtility() |
Modifier and Type | Method and Description |
---|---|
int |
checksum(byte[] buf) |
int |
checksum(byte[] buf,
int sze) |
int |
checksum(byte[] buf,
int off,
int sze) |
int |
checksum(ByteBuffer buf)
Compute the
Adler32 checksum of the buffer. |
int |
checksum(ByteBuffer buf,
int pos,
int limit)
Compute the
Adler32 checksum of the buffer. |
int |
checksum(IByteArraySlice slice) |
protected int |
getChecksum()
Return the Alder checksum, which is a 32bit value.
|
static ChecksumUtility |
getCHK()
static access to a ThreadLocal Checksum utility
|
protected void |
reset()
Reset the checksum.
|
protected void |
update(ByteBuffer buf)
Updates the
Adler32 checksum from the data in the buffer. |
protected void |
update(ByteBuffer buf,
int pos,
int limit)
Core implementation updates the
Adler32 checksum from the data in
the buffer. |
public static final ThreadLocal<ChecksumUtility> threadChk
ChecksumUtility
factory.protected final Adler32 chk
public static ChecksumUtility getCHK()
public int checksum(ByteBuffer buf)
Adler32
checksum of the buffer. The position, mark,
and limit are unchanged by this operation. The operation is optimized
when the buffer is backed by an array.buf
- The buffer.public int checksum(ByteBuffer buf, int pos, int limit)
Adler32
checksum of the buffer. The position,
mark, and limit are unchanged by this operation. The operation is
optimized when the buffer is backed by an array.buf
- The buffer.pos
- The starting position.limit
- The limit.protected void reset()
protected int getChecksum()
protected void update(ByteBuffer buf)
Adler32
checksum from the data in the buffer. The
position, mark, and limit are unchanged by this operation. The operation
is optimized when the buffer is backed by an array.buf
- protected void update(ByteBuffer buf, int pos, int limit)
Adler32
checksum from the data in
the buffer. The position, mark, and limit are unchanged by this
operation. The operation is optimized when the buffer is backed by an
array.buf
- pos
- limit
- public int checksum(IByteArraySlice slice)
public int checksum(byte[] buf)
public int checksum(byte[] buf, int sze)
public int checksum(byte[] buf, int off, int sze)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.