| java.lang.Object jj2000.j2k.io.BufferedRandomAccessFile jj2000.j2k.io.BEBufferedRandomAccessFile
Method Summary | |
final public double | readDouble() Reads an IEEE double precision (i.e., 64 bit) floating-point number
from the input. | final public float | readFloat() Reads an IEEE single precision (i.e., 32 bit) floating-point number
from the input. | final public int | readInt() Reads a signed int (i.e., 32 bit) from the input. | final public long | readLong() Reads a signed long (i.e., 64 bit) from the input. | final public short | readShort() Reads a signed short (i.e., 16 bit) from the input. | final public long | readUnsignedInt() Reads an unsigned int (i.e., 32 bit) from the input. | final public int | readUnsignedShort() Reads an unsigned short (i.e., 16 bit) from the input. | public String | toString() | final public void | writeDouble(double v) Writes the IEEE double value v (i.e., 64 bits) to the
output. | final public void | writeFloat(float v) Writes the IEEE float value v (i.e., 32 bits) to the
output. | final public void | writeInt(int v) Writes the int value of v (i.e., the 32 bits) to the
output. | final public void | writeLong(long v) Writes the long value of v (i.e., the 64 bits) to the
output. | final public void | writeShort(int v) Writes the short value of v (i.e., 16 least significant bits)
to the output. |
BEBufferedRandomAccessFile | public BEBufferedRandomAccessFile(File file, String mode, int bufferSize) throws IOException(Code) | | Constructor. Always needs a size for the buffer.
Parameters: file - The file associated with the buffer Parameters: mode - "r" for read, "rw" or "rw+" for read and write mode ("rw+"opens the file for update whereas "rw" removes itbefore. So the 2 modes are different only if the filealready exists). Parameters: bufferSize - The number of bytes to buffer exception: java.io.IOException - If an I/O error ocurred. |
BEBufferedRandomAccessFile | public BEBufferedRandomAccessFile(File file, String mode) throws IOException(Code) | | Constructor. Uses the default value for the byte-buffer size (512
bytes).
Parameters: file - The file associated with the buffer Parameters: mode - "r" for read, "rw" or "rw+" for read and write mode ("rw+"opens the file for update whereas "rw" removes itbefore. So the 2 modes are different only if the filealready exists). exception: java.io.IOException - If an I/O error ocurred. |
BEBufferedRandomAccessFile | public BEBufferedRandomAccessFile(String name, String mode, int bufferSize) throws IOException(Code) | | Constructor. Always needs a size for the buffer.
Parameters: name - The name of the file associated with the buffer Parameters: mode - "r" for read, "rw" or "rw+" for read and write mode ("rw+"opens the file for update whereas "rw" removes itbefore. So the 2 modes are different only if the filealready exists). Parameters: bufferSize - The number of bytes to buffer exception: java.io.IOException - If an I/O error ocurred. |
BEBufferedRandomAccessFile | public BEBufferedRandomAccessFile(String name, String mode) throws IOException(Code) | | Constructor. Uses the default value for the byte-buffer size (512
bytes).
Parameters: name - The name of the file associated with the buffer Parameters: mode - "r" for read, "rw" or "rw+" for read and write mode ("rw+"opens the file for update whereas "rw" removes itbefore. So the 2 modes are different only if the filealready exists). exception: java.io.IOException - If an I/O error ocurred. |
readDouble | final public double readDouble() throws IOException, EOFException(Code) | | Reads 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: java.io.EOFException - If the end-of file was reached beforegetting all the necessary data. exception: java.io.IOException - If an I/O error ocurred. |
readFloat | final public float readFloat() throws EOFException, IOException(Code) | | Reads 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: java.io.EOFException - If the end-of file was reached beforegetting all the necessary data. exception: java.io.IOException - If an I/O error ocurred. |
readInt | final public int readInt() throws IOException, EOFException(Code) | | Reads 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: java.io.EOFException - If the end-of file was reached beforegetting all the necessary data. exception: java.io.IOException - If an I/O error ocurred. |
readLong | final public long readLong() throws IOException, EOFException(Code) | | Reads 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: java.io.EOFException - If the end-of file was reached beforegetting all the necessary data. exception: java.io.IOException - If an I/O error ocurred. |
readShort | final public short readShort() throws IOException, EOFException(Code) | | Reads 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: java.io.EOFException - If the end-of file was reached beforegetting all the necessary data. exception: java.io.IOException - If an I/O error ocurred. |
readUnsignedInt | final public long readUnsignedInt() throws IOException, EOFException(Code) | | Reads 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: java.io.EOFException - If the end-of file was reached beforegetting all the necessary data. exception: java.io.IOException - If an I/O error ocurred. |
readUnsignedShort | final public int readUnsignedShort() throws IOException, EOFException(Code) | | Reads 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: java.io.EOFException - If the end-of file was reached beforegetting all the necessary data. exception: java.io.IOException - If an I/O error ocurred. |
toString | public String toString()(Code) | | Returns a string of information about the file and the endianess
|
writeDouble | final public void writeDouble(double v) throws IOException(Code) | | Writes the IEEE double value v (i.e., 64 bits) to the
output. Prior to writing, the output should be realigned at the byte
level.
Parameters: v - The value to write to the output exception: java.io.IOException - If an I/O error ocurred. |
writeFloat | final public void writeFloat(float v) throws IOException(Code) | | Writes the IEEE float value v (i.e., 32 bits) to the
output. Prior to writing, the output should be realigned at the byte
level.
Parameters: v - The value to write to the output exception: java.io.IOException - If an I/O error ocurred. |
writeInt | final public void writeInt(int v) throws IOException(Code) | | Writes the int value of v (i.e., the 32 bits) to the
output. Prior to writing, the output should be realigned at the byte
level.
Parameters: v - The value to write to the output exception: java.io.IOException - If an I/O error ocurred. |
writeLong | final public void writeLong(long v) throws IOException(Code) | | Writes the long value of v (i.e., the 64 bits) to the
output. Prior to writing, the output should be realigned at the byte
level.
Parameters: v - The value to write to the output exception: java.io.IOException - If an I/O error ocurred. |
writeShort | final public void writeShort(int v) throws IOException(Code) | | Writes the short value of v (i.e., 16 least significant bits)
to the output. Prior to writing, the output should be realigned at the
byte level.
Signed or unsigned data can be written. To write a signed value just
pass the short value as an argument. To write unsigned data
pass the int value as an argument (it will be automatically
casted, and only the 16 least significant bits will be written).
Parameters: v - The value to write to the output exception: java.io.IOException - If an I/O error ocurred. |
|
|