C# Класс 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.
Наследование: BufferedRandomAccessFile, RandomAccessIO, EndianType
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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).

Описание методов

BEBufferedRandomAccessFile() публичный Метод

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.
Результат System

BEBufferedRandomAccessFile() публичный Метод

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
Результат System

BEBufferedRandomAccessFile() публичный Метод

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). /// ///
Результат System

BEBufferedRandomAccessFile() публичный Метод

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 /// ///
Результат System

ToString() публичный Метод

Returns a string of information about the file and the endianess
public ToString ( ) : System.String
Результат System.String

readDouble() публичный Метод

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
Результат double

readFloat() публичный Метод

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
Результат float

readInt() публичный Метод

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
Результат int

readLong() публичный Метод

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
Результат long

readShort() публичный Метод

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
Результат short

readUnsignedInt() публичный Метод

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
Результат long

readUnsignedShort() публичный Метод

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
Результат int

writeDouble() публичный Метод

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 /// ///
Результат void

writeFloat() публичный Метод

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 /// ///
Результат void

writeInt() публичный Метод

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 /// ///
Результат void

writeLong() публичный Метод

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 /// ///
Результат void

writeShort() публичный Метод

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 /// ///
Результат void