| jj2000.j2k.io.BinaryDataInput
BinaryDataInput | public interface BinaryDataInput (Code) | | 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).
See Also: EndianType |
Method Summary | |
public int | getByteOrdering() Returns the endianess (i.e., byte ordering) of the implementing
class. | public byte | readByte() Should read a signed byte (i.e., 8 bit) from the input. | public double | readDouble() Should read an IEEE double precision (i.e., 64 bit)
floating-point number from the input. | public float | readFloat() Should read an IEEE single precision (i.e., 32 bit)
floating-point number from the input. | public int | readInt() Should read a signed int (i.e., 32 bit) from the input. | public long | readLong() Should read a signed long (i.e., 64 bit) from the input. | public short | readShort() Should read a signed short (i.e., 16 bit) from the input. | public int | readUnsignedByte() Should read an unsigned byte (i.e., 8 bit) from the input. | public long | readUnsignedInt() Should read an unsigned int (i.e., 32 bit) from the input. | public int | readUnsignedShort() Should read an unsigned short (i.e., 16 bit) from the input. | public int | skipBytes(int n) Skips n bytes from the input. |
getByteOrdering | public int getByteOrdering()(Code) | | Returns the endianess (i.e., byte ordering) of the implementing
class. Note that an implementing class may implement only one
type of endianness or both, which would be decided at creatiuon
time.
Either EndianType.BIG_ENDIAN orEndianType.LITTLE_ENDIAN See Also: EndianType |
readByte | public byte readByte() throws EOFException, IOException(Code) | | Should read a signed byte (i.e., 8 bit) from the input.
reading, the input should be realigned at the byte level.
The next byte-aligned signed byte (8 bit) from theinput. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readDouble | public double readDouble() throws EOFException, IOException(Code) | | Should read an IEEE double precision (i.e., 64 bit)
floating-point number from the input. Prior to reading, the
input should be realigned at the byte level.
The next byte-aligned IEEE double (64 bit) from theinput. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readFloat | public float readFloat() throws EOFException, IOException(Code) | | Should read an IEEE single precision (i.e., 32 bit)
floating-point number from the input. Prior to reading, the
input should be realigned at the byte level.
The next byte-aligned IEEE float (32 bit) from theinput. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readInt | public int readInt() throws EOFException, IOException(Code) | | Should read a signed int (i.e., 32 bit) from the input. Prior to
reading, the input should be realigned at the byte level.
The next byte-aligned signed int (32 bit) from theinput. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readLong | public long readLong() throws EOFException, IOException(Code) | | Should read a signed long (i.e., 64 bit) from the input. Prior to
reading, the input should be realigned at the byte level.
The next byte-aligned signed long (64 bit) from theinput. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readShort | public short readShort() throws EOFException, IOException(Code) | | Should read a signed short (i.e., 16 bit) from the input. Prior to
reading, the input should be realigned at the byte level.
The next byte-aligned signed short (16 bit) from theinput. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readUnsignedByte | public int readUnsignedByte() throws EOFException, IOException(Code) | | Should read an unsigned byte (i.e., 8 bit) from the input. It is
returned as an int since Java does not have an
unsigned byte type. Prior to reading, the input should be
realigned at the byte level.
The next byte-aligned unsigned byte (8 bit) from theinput, as an int. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readUnsignedInt | public long readUnsignedInt() throws EOFException, IOException(Code) | | Should read an unsigned int (i.e., 32 bit) from the input. It is
returned as a long since Java does not have an
unsigned short type. Prior to reading, the input should be
realigned at the byte level.
The next byte-aligned unsigned int (32 bit) from theinput, as a long. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
readUnsignedShort | public int readUnsignedShort() throws EOFException, IOException(Code) | | Should read an unsigned short (i.e., 16 bit) from the input. It is
returned as an int since Java does not have an
unsigned short type. Prior to reading, the input should be
realigned at the byte level.
The next byte-aligned unsigned short (16 bit) from theinput, as an int. exception: EOFException - If the end-of file was reached beforegetting all the necessary data. exception: IOException - If an I/O error ocurred. |
skipBytes | public int skipBytes(int n) throws EOFException, IOException(Code) | | Skips n bytes from the input. Prior to skipping, the
input should be realigned at the byte level.
Parameters: n - The number of bytes to skip exception: EOFException - If the end-of file was reached beforeall the bytes could be skipped. exception: IOException - If an I/O error ocurred. |
|
|