C# Class CSJ2K.j2k.io.BEBufferedRandomAccessFile

This class defines a Buffered Random Access File, where all I/O is considered to be big-endian. It extends the BufferedRandomAccessFile class.
Inheritance: BufferedRandomAccessFile, RandomAccessIO, EndianType
Afficher le fichier Open project: cureos/csj2k Class Usage Examples

Méthodes publiques

Méthode Description
BEBufferedRandomAccessFile ( Stream stream, bool isReadOnly ) : System

Constructor. Uses the default value for the byte-buffer size (512 bytes).

BEBufferedRandomAccessFile ( Stream stream, bool isReadOnly, int bufferSize ) : System

Constructor. Always needs a size for the buffer.

BEBufferedRandomAccessFile ( System name, System mode ) : System

Constructor. Uses the default value for the byte-buffer size (512 bytes).

BEBufferedRandomAccessFile ( System name, System mode, int bufferSize ) : System

Constructor. Always needs a size for the buffer.

ToString ( ) : System.String

Returns a string of information about the file and the endianess

readDouble ( ) : double

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.

readFloat ( ) : float

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.

readInt ( ) : int

Reads a signed int (i.e., 32 bit) from the input. Prior to reading, the input should be realigned at the byte level.

readLong ( ) : long

Reads a signed long (i.e., 64 bit) from the input. Prior to reading, the input should be realigned at the byte level.

readShort ( ) : short

Reads a signed short (i.e. 16 bit) from the input. Prior to reading, the input should be realigned at the byte level.

readUnsignedInt ( ) : long

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.

readUnsignedShort ( ) : int

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.

writeDouble ( double v ) : void

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.

writeFloat ( float v ) : void

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.

writeInt ( int v ) : void

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.

writeLong ( long v ) : void

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.

writeShort ( int v ) : void

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).

Method Details

BEBufferedRandomAccessFile() public méthode

Constructor. Uses the default value for the byte-buffer size (512 bytes).
If an I/O error ocurred.
public BEBufferedRandomAccessFile ( Stream stream, bool isReadOnly ) : System
stream Stream The stream associated with the buffer
isReadOnly bool Indicates whether file is read-only or not.
Résultat System

BEBufferedRandomAccessFile() public méthode

Constructor. Always needs a size for the buffer.
If an I/O error ocurred. /// ///
public BEBufferedRandomAccessFile ( Stream stream, bool isReadOnly, int bufferSize ) : System
stream Stream The stream associated with the buffer
isReadOnly bool Indicates whether file is read-only or not.
bufferSize int The number of bytes to buffer
Résultat System

BEBufferedRandomAccessFile() public méthode

Constructor. Uses the default value for the byte-buffer size (512 bytes).
If an I/O error ocurred. /// ///
public BEBufferedRandomAccessFile ( System name, System mode ) : System
name System The name of the file associated with the buffer /// ///
mode System "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). /// ///
Résultat System

BEBufferedRandomAccessFile() public méthode

Constructor. Always needs a size for the buffer.
If an I/O error ocurred. /// ///
public BEBufferedRandomAccessFile ( System name, System mode, int bufferSize ) : System
name System The name of the file associated with the buffer /// ///
mode System "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 int The number of bytes to buffer /// ///
Résultat System

ToString() public méthode

Returns a string of information about the file and the endianess
public ToString ( ) : System.String
Résultat System.String

readDouble() public méthode

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.
If the end-of file was reached before /// getting all the necessary data. /// /// If an I/O error ocurred. /// ///
public readDouble ( ) : double
Résultat double

readFloat() public méthode

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.
If the end-of file was reached before /// getting all the necessary data. /// /// If an I/O error ocurred. /// ///
public readFloat ( ) : float
Résultat float

readInt() public méthode

Reads a signed int (i.e., 32 bit) from the input. Prior to reading, the input should be realigned at the byte level.
If the end-of file was reached before /// getting all the necessary data. /// /// If an I/O error ocurred. /// ///
public readInt ( ) : int
Résultat int

readLong() public méthode

Reads a signed long (i.e., 64 bit) from the input. Prior to reading, the input should be realigned at the byte level.
If the end-of file was reached before /// getting all the necessary data. /// /// If an I/O error ocurred. /// ///
public readLong ( ) : long
Résultat long

readShort() public méthode

Reads a signed short (i.e. 16 bit) from the input. Prior to reading, the input should be realigned at the byte level.
If the end-of file was reached before /// getting all the necessary data. /// /// If an I/O error ocurred. /// ///
public readShort ( ) : short
Résultat short

readUnsignedInt() public méthode

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.
If the end-of file was reached before /// getting all the necessary data. /// /// If an I/O error ocurred. /// ///
public readUnsignedInt ( ) : long
Résultat long

readUnsignedShort() public méthode

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.
If the end-of file was reached before /// getting all the necessary data. /// /// If an I/O error ocurred. /// ///
public readUnsignedShort ( ) : int
Résultat int

writeDouble() public méthode

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.
If an I/O error ocurred. /// ///
public writeDouble ( double v ) : void
v double The value to write to the output /// ///
Résultat void

writeFloat() public méthode

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.
If an I/O error ocurred. /// ///
public writeFloat ( float v ) : void
v float The value to write to the output /// ///
Résultat void

writeInt() public méthode

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.
If an I/O error ocurred. /// ///
public writeInt ( int v ) : void
v int The value to write to the output /// ///
Résultat void

writeLong() public méthode

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.
If an I/O error ocurred. /// ///
public writeLong ( long v ) : void
v long The value to write to the output /// ///
Résultat void

writeShort() public méthode

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).

If an I/O error ocurred. /// ///
public writeShort ( int v ) : void
v int The value to write to the output /// ///
Résultat void