public class CRC32Stream extends Stream
| Modifier and Type | Field and Description |
|---|---|
static int[] |
crcTable
The fast CRC table.
|
skipBuffer| Constructor and Description |
|---|
CRC32Stream(Stream s) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This method does nothing.
|
long |
getValue()
Returns the CRC32 data checksum computed so far.
|
int |
readBytes(byte[] buf,
int start,
int count)
Computes the checksum for the bytes read from the attached stream.
|
void |
reset()
Resets the CRC32 data checksum so a new CRC32 can be computed.
|
void |
update(byte[] buf,
int off,
int len)
Updates the CRC32 with the values of the given buffer.
|
int |
writeBytes(byte[] buf,
int start,
int count)
Computes the checksum for the given bytes, then write them to the attached stream.
|
asInputStream, asOutputStream, asStream, asStream, skipBytes, wrapInputStream, wrapInputStreamToStream, write, writeBytes, writeBytes, writeBytespublic static int[] crcTable
public CRC32Stream(Stream s)
public long getValue()
int, but then the value may be negative.public void reset()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic void update(byte[] buf,
int off,
int len)
public int readBytes(byte[] buf,
int start,
int count)
throws IOException
readBytes in class Streambuf - the byte array to read data intostart - the start position in the arraycount - the number of bytes to readIOExceptionpublic int writeBytes(byte[] buf,
int start,
int count)
throws IOException
writeBytes in class Streambuf - the byte array to write data fromstart - the start position in the byte arraycount - the number of bytes to writeIOException