public class CRCInputStream extends FilterInputStream
| Modifier and Type | Field and Description |
|---|---|
protected CRC |
crc |
in| Constructor and Description |
|---|
CRCInputStream(InputStream in,
CRC crc)
Create a CRCInputStream using the specified CRC generator
|
| Modifier and Type | Method and Description |
|---|---|
CRC |
getCRC() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
boolean |
readCRCAndCheck()
Read CRC from the stream itself, and check that it matches with the generated from the previous bytes.
|
void |
setCRC(CRC crc)
Set a new CRC generator from the current read byte onwards.
|
available, close, mark, markSupported, reset, skipprotected CRC crc
public CRCInputStream(InputStream in, CRC crc)
in - crc - public void setCRC(CRC crc)
crc - public CRC getCRC()
public boolean readCRCAndCheck()
throws IOException
IOExceptionpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionCopyright © 2018 DataWeb Research. All rights reserved.