|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the input of binary data from streams and/or files.
Byte level input (i.e., for byte, int, long, float, etc.) should always be byte aligned. For example, a request to read an int should always realign the input at the byte level.
The implementation of this interface should clearly define if multi-byte input data is read in little- or big-endian byte ordering (least significant byte first or most significant byte first, respectively).
EndianType
Method Summary | |
int |
getByteOrdering()
Returns the endianess (i.e., byte ordering) of the implementing class. |
byte |
readByte()
Should read a signed byte (i.e., 8 bit) from the input. |
double |
readDouble()
Should read an IEEE double precision (i.e., 64 bit) floating-point number from the input. |
float |
readFloat()
Should read an IEEE single precision (i.e., 32 bit) floating-point number from the input. |
int |
readInt()
Should read a signed int (i.e., 32 bit) from the input. |
long |
readLong()
Should read a signed long (i.e., 64 bit) from the input. |
short |
readShort()
Should read a signed short (i.e., 16 bit) from the input. |
int |
readUnsignedByte()
Should read an unsigned byte (i.e., 8 bit) from the input. |
long |
readUnsignedInt()
Should read an unsigned int (i.e., 32 bit) from the input. |
int |
readUnsignedShort()
Should read an unsigned short (i.e., 16 bit) from the input. |
int |
skipBytes(int n)
Skips n bytes from the input. |
Method Detail |
public byte readByte() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public int readUnsignedByte() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public short readShort() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public int readUnsignedShort() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public int readInt() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public long readUnsignedInt() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public long readLong() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public float readFloat() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public double readDouble() throws java.io.EOFException, java.io.IOException
java.io.EOFException
- If the end-of file was reached before getting
all the necessary data.
java.io.IOException
- If an I/O error ocurred.public int getByteOrdering()
EndianType
public int skipBytes(int n) throws java.io.EOFException, java.io.IOException
n
- The number of bytes to skip
java.io.EOFException
- If the end-of file was reached before all the
bytes could be skipped.
java.io.IOException
- If an I/O error ocurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |