public class BEBufferedRandomAccessFile extends BufferedRandomAccessFile implements RandomAccessIO, EndianType
byteBuffer, byteBufferChanged, byteOrdering, isEOFInBuffer, maxByte, offset, pos
BIG_ENDIAN, LITTLE_ENDIAN
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
close, flush, getByteOrdering, getPos, length, read, readByte, readFully, readNewBuffer, readUnsignedByte, seek, skipBytes, write, write, write, writeByte
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getPos, length, read, readFully, seek, write
getByteOrdering, readByte, readUnsignedByte, skipBytes
flush, getByteOrdering, writeByte
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 bufferjava.io.IOException
- If an I/O error ocurred.public 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).java.io.IOException
- If an I/O error ocurred.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 bufferjava.io.IOException
- If an I/O error ocurred.public 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).java.io.IOException
- If an I/O error ocurred.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).
writeShort
in interface BinaryDataOutput
v
- The value to write to the outputjava.io.IOException
- If an I/O error ocurred.public final void writeInt(int v) throws java.io.IOException
writeInt
in interface BinaryDataOutput
v
- The value to write to the outputjava.io.IOException
- If an I/O error ocurred.public final void writeLong(long v) throws java.io.IOException
writeLong
in interface BinaryDataOutput
v
- The value to write to the outputjava.io.IOException
- If an I/O error ocurred.public final void writeFloat(float v) throws java.io.IOException
writeFloat
in interface BinaryDataOutput
v
- The value to write to the outputjava.io.IOException
- If an I/O error ocurred.public final void writeDouble(double v) throws java.io.IOException
writeDouble
in interface BinaryDataOutput
v
- The value to write to the outputjava.io.IOException
- If an I/O error ocurred.public final short readShort() throws java.io.IOException, java.io.EOFException
readShort
in interface BinaryDataInput
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 final int readUnsignedShort() throws java.io.IOException, java.io.EOFException
readUnsignedShort
in interface BinaryDataInput
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 final int readInt() throws java.io.IOException, java.io.EOFException
readInt
in interface BinaryDataInput
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 final long readUnsignedInt() throws java.io.IOException, java.io.EOFException
readUnsignedInt
in interface BinaryDataInput
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 final long readLong() throws java.io.IOException, java.io.EOFException
readLong
in interface BinaryDataInput
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 final float readFloat() throws java.io.EOFException, java.io.IOException
readFloat
in interface BinaryDataInput
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 final double readDouble() throws java.io.IOException, java.io.EOFException
readDouble
in interface BinaryDataInput
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 java.lang.String toString()
toString
in class BufferedRandomAccessFile
Copyright © 2014 Open Microscopy Environment