|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RandomAccessIO
This abstract class defines the interface to perform random access I/O. It implements the BinaryDataInput and BinaryDataOutput interfaces so that binary data input/output can be performed.
This interface supports streams of up to 2 GB in length.
BinaryDataInput,
BinaryDataOutput| Method Summary | |
|---|---|
void |
close()
Closes the I/O stream. |
int |
getPos()
Returns the current position in the stream, which is the position from where the next byte of data would be read. |
int |
length()
Returns the current length of the stream, in bytes, taking into account any buffering. |
int |
read()
Reads a byte of data from the stream. |
void |
readFully(byte[] b,
int off,
int len)
Reads up to len bytes of data from this file into an array of bytes. |
void |
seek(int off)
Moves the current position for the next read or write operation to offset. |
void |
write(int b)
Writes a byte to the stream. |
| Methods inherited from interface ucar.jpeg.jj2000.j2k.io.BinaryDataInput |
|---|
getByteOrdering, readByte, readDouble, readFloat, readInt, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, skipBytes |
| Methods inherited from interface ucar.jpeg.jj2000.j2k.io.BinaryDataOutput |
|---|
flush, getByteOrdering, writeByte, writeDouble, writeFloat, writeInt, writeLong, writeShort |
| Method Detail |
|---|
void close()
throws IOException
IOException - If an I/O error ocurred.
int getPos()
throws IOException
IOException - If an I/O error ocurred.
int length()
throws IOException
IOException - If an I/O error ocurred.
void seek(int off)
throws IOException
off - The offset where to move to.
EOFException - If in read-only and seeking beyond EOF.
IOException - If an I/O error ocurred.
int read()
throws EOFException,
IOException
EOFException - If the end-of file was reached.
IOException - If an I/O error ocurred.
void readFully(byte[] b,
int off,
int len)
throws IOException
b - The buffer into which the data is to be read. It must be long
enough.off - The index in 'b' where to place the first byte read.len - The number of bytes to read.
EOFException - If the end-of file was reached before
getting all the necessary data.
IOException - If an I/O error ocurred.
void write(int b)
throws IOException
b - The byte to write. The lower 8 bits of b are
written.
IOException - If an I/O error ocurred.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||