限定符和类型 | 字段和说明 |
---|---|
static int |
CHECKSUM_CRC32 |
static int |
CHECKSUM_NULL |
static int |
HEADER_LEN |
static int |
SIZE_OF_INTEGER |
限定符和类型 | 方法和说明 |
---|---|
boolean |
compare(byte[] buf,
int offset)
Compares the checksum located at buf[offset] with the current checksum.
|
int |
getBytesPerChecksum() |
static int |
getChecksumHeaderSize() |
int |
getChecksumSize() |
int |
getChecksumType() |
byte[] |
getHeader() |
int |
getNumBytesInSum() |
long |
getValue() |
static DataChecksum |
newDataChecksum(byte[] bytes,
int offset)
Creates a DataChecksum from HEADER_LEN bytes from arr[offset].
|
static DataChecksum |
newDataChecksum(DataInputStream in)
This constructucts a DataChecksum by reading HEADER_LEN bytes from
input stream in
|
static DataChecksum |
newDataChecksum(int type,
int bytesPerChecksum) |
void |
reset() |
void |
update(byte[] b,
int off,
int len) |
void |
update(int b) |
void |
writeHeader(DataOutputStream out)
Writes the checksum header to the output stream out.
|
int |
writeValue(byte[] buf,
int offset,
boolean reset)
Writes the current checksum to a buffer.
|
int |
writeValue(DataOutputStream out,
boolean reset)
Writes the current checksum to the stream.
|
public static final int HEADER_LEN
public static final int CHECKSUM_NULL
public static final int CHECKSUM_CRC32
public static final int SIZE_OF_INTEGER
public static DataChecksum newDataChecksum(int type, int bytesPerChecksum)
public static DataChecksum newDataChecksum(byte[] bytes, int offset)
public static DataChecksum newDataChecksum(DataInputStream in) throws IOException
IOException
public void writeHeader(DataOutputStream out) throws IOException
IOException
public byte[] getHeader()
public int writeValue(DataOutputStream out, boolean reset) throws IOException
IOException
public int writeValue(byte[] buf, int offset, boolean reset) throws IOException
IOException
public boolean compare(byte[] buf, int offset)
public int getChecksumType()
public int getChecksumSize()
public int getBytesPerChecksum()
public int getNumBytesInSum()
public static int getChecksumHeaderSize()
Copyright © 2009 The Apache Software Foundation