|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
totalcross.lang.Objecttotalcross.io.Stream
totalcross.io.CRC32Stream
public class CRC32Stream
Computes CRC32 data checksum of a stream. The actual CRC32 algorithm is described in RFC 1952 (GZIP file format specification version 4.3). Can be used to get the CRC32 over a stream if used with input/output streams.
| Field Summary | |
|---|---|
static int[] |
crcTable
The fast CRC table. |
| Fields inherited from class totalcross.io.Stream |
|---|
skipBuffer |
| Constructor Summary | |
|---|---|
CRC32Stream(Stream s)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class totalcross.io.Stream |
|---|
skipBytes, writeBytes, writeBytes |
| Methods inherited from class totalcross.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int[] crcTable
| Constructor Detail |
|---|
public CRC32Stream(Stream s)
| Method Detail |
|---|
public long getValue()
int, but then the value may be negative.
public void reset()
public void close()
public 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 read
IOException
public 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 write
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||