public class LittleEndianByteInputStream extends java.io.InputStream implements ByteConstants
BXY_ID, NUFILE_ID, NUFX_ID, TIMEREC_DAY, TIMEREC_HOUR, TIMEREC_LENGTH, TIMEREC_MINUTE, TIMEREC_MONTH, TIMEREC_NULL, TIMEREC_SECOND, TIMEREC_WEEKDAY, TIMEREC_YEAR| Constructor and Description |
|---|
LittleEndianByteInputStream(byte[] data)
Construct a LittleEndianByteInputStream from a byte array.
|
LittleEndianByteInputStream(java.io.InputStream inputStream)
Construct a LittleEndianByteInputStream from an InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCrcValue()
Get the current CRC-16 value.
|
long |
getTotalBytesRead()
Answer with the total number of bytes read.
|
int |
read()
Get the next byte.
|
int |
readByte()
Get the next byte and fail if we are at EOF.
|
byte[] |
readBytes(int bytes)
Get the next set of bytes as an array.
|
java.util.Date |
readDate()
Read the TimeRec into a Java Date object.
|
long |
readLong()
Read the two bytes in as a "Long" which needs to be stored as a Java long.
|
int |
readWord()
Read the two bytes in as a "Word" which needs to be stored as a Java int.
|
void |
resetCrc()
Reset the CRC-16 to $0000.
|
int |
seekFileType()
Test the beginning of the data stream for a magic signature, for up to a total
of 2k bytes of leading garbage
|
int |
seekFileType(int max)
Test the beginning of the data stream for a magic signature, specifying the
maximum size of a signature to test for
|
public LittleEndianByteInputStream(java.io.InputStream inputStream)
public LittleEndianByteInputStream(byte[] data)
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int readByte()
throws java.io.IOException
java.io.IOExceptionpublic byte[] readBytes(int bytes)
throws java.io.IOException
java.io.IOExceptionpublic int seekFileType()
throws java.io.IOException
java.io.IOExceptionpublic int seekFileType(int max)
throws java.io.IOException
java.io.IOExceptionpublic int readWord()
throws java.io.IOException
java.io.IOExceptionpublic long readLong()
throws java.io.IOException
java.io.IOExceptionpublic java.util.Date readDate()
throws java.io.IOException
java.io.IOExceptionpublic void resetCrc()
public long getCrcValue()
public long getTotalBytesRead()