|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.dfs.DataChecksum
public class DataChecksum
This class provides inteface and utilities for processing checksums for DFS data transfers.
| Field Summary | |
|---|---|
static int |
CHECKSUM_CRC32
|
static int |
CHECKSUM_NULL
|
static int |
HEADER_LEN
|
| Method Summary | |
|---|---|
boolean |
compare(byte[] buf,
int offset)
Compares the checksum located at buf[offset] with the current checksum. |
int |
getBytesPerChecksum()
|
int |
getChecksumSize()
|
int |
getChecksumType()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int HEADER_LEN
public static final int CHECKSUM_NULL
public static final int CHECKSUM_CRC32
| Method Detail |
|---|
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 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 long getValue()
getValue in interface Checksumpublic void reset()
reset in interface Checksum
public void update(byte[] b,
int off,
int len)
update in interface Checksumpublic void update(int b)
update in interface Checksum
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||