|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.io.BufferedRandomAccessFile | +--jj2000.j2k.io.BEBufferedRandomAccessFile
This class defines a Buffered Random Access File, where all I/O is considered to be big-endian, and extends the BufferedRandomAccessFile class.
RandomAccessIO
,
BinaryDataOutput
,
BinaryDataInput
,
BufferedRandomAccessFile
Fields inherited from class jj2000.j2k.io.BufferedRandomAccessFile |
byteBuffer,
byteBufferChanged,
byteOrdering,
fileName,
isEOFInBuffer,
isReadOnly,
maxByte,
offset,
pos,
theFile |
Fields inherited from interface jj2000.j2k.io.EndianType |
BIG_ENDIAN,
LITTLE_ENDIAN |
Constructor Summary | |
BEBufferedRandomAccessFile(java.io.File file,
java.lang.String mode)
Constructor. |
|
BEBufferedRandomAccessFile(java.io.File file,
java.lang.String mode,
int bufferSize)
Constructor. |
|
BEBufferedRandomAccessFile(java.lang.String name,
java.lang.String mode)
Constructor. |
|
BEBufferedRandomAccessFile(java.lang.String name,
java.lang.String mode,
int bufferSize)
Constructor. |
Method Summary | |
double |
readDouble()
Reads an IEEE double precision (i.e., 64 bit) floating-point number from the input. |
float |
readFloat()
Reads an IEEE single precision (i.e., 32 bit) floating-point number from the input. |
int |
readInt()
Reads a signed int (i.e., 32 bit) from the input. |
long |
readLong()
Reads a signed long (i.e., 64 bit) from the input. |
short |
readShort()
Reads a signed short (i.e., 16 bit) from the input. |
long |
readUnsignedInt()
Reads an unsigned int (i.e., 32 bit) from the input. |
int |
readUnsignedShort()
Reads an unsigned short (i.e., 16 bit) from the input. |
java.lang.String |
toString()
Returns a string of information about the file and the endianess |
void |
writeDouble(double v)
Writes the IEEE double value v (i.e., 64 bits) to the output. |
void |
writeFloat(float v)
Writes the IEEE float value v (i.e., 32 bits) to the output. |
void |
writeInt(int v)
Writes the int value of v (i.e., the 32 bits) to the output. |
void |
writeLong(long v)
Writes the long value of v (i.e., the 64 bits) to the output. |
void |
writeShort(int v)
Writes the short value of v (i.e., 16 least significant bits) to the output. |
Methods inherited from class jj2000.j2k.io.BufferedRandomAccessFile |
close,
flush,
getByteOrdering,
getPos,
length,
read,
readByte,
readFully,
readNewBuffer,
readUnsignedByte,
seek,
skipBytes,
write,
write,
write,
writeByte |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public BEBufferedRandomAccessFile(java.io.File file, java.lang.String mode, int bufferSize) throws java.io.IOException
file
- The file associated with the buffermode
- "r" for read, "rw" or "rw+" for read and write mode ("rw+"
opens the file for update whereas "rw" removes it
before. So the 2 modes are different only if the file
already exists).bufferSize
- The number of bytes to bufferpublic BEBufferedRandomAccessFile(java.io.File file, java.lang.String mode) throws java.io.IOException
file
- The file associated with the buffermode
- "r" for read, "rw" or "rw+" for read and write mode ("rw+"
opens the file for update whereas "rw" removes it
before. So the 2 modes are different only if the file
already exists).public BEBufferedRandomAccessFile(java.lang.String name, java.lang.String mode, int bufferSize) throws java.io.IOException
name
- The name of the file associated with the buffermode
- "r" for read, "rw" or "rw+" for read and write mode ("rw+"
opens the file for update whereas "rw" removes it
before. So the 2 modes are different only if the file
already exists).bufferSize
- The number of bytes to bufferpublic BEBufferedRandomAccessFile(java.lang.String name, java.lang.String mode) throws java.io.IOException
name
- The name of the file associated with the buffermode
- "r" for read, "rw" or "rw+" for read and write mode ("rw+"
opens the file for update whereas "rw" removes it
before. So the 2 modes are different only if the file
already exists).Method Detail |
public final void writeShort(int v) throws java.io.IOException
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).
v
- The value to write to the outputpublic final void writeInt(int v) throws java.io.IOException
v
- The value to write to the outputpublic final void writeLong(long v) throws java.io.IOException
v
- The value to write to the outputpublic final void writeFloat(float v) throws java.io.IOException
v
- The value to write to the outputpublic final void writeDouble(double v) throws java.io.IOException
v
- The value to write to the outputpublic final short readShort() throws java.io.IOException, java.io.EOFException
public final int readUnsignedShort() throws java.io.IOException, java.io.EOFException
public final int readInt() throws java.io.IOException, java.io.EOFException
public final long readUnsignedInt() throws java.io.IOException, java.io.EOFException
public final long readLong() throws java.io.IOException, java.io.EOFException
public final float readFloat() throws java.io.EOFException, java.io.IOException
public final double readDouble() throws java.io.IOException, java.io.EOFException
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |