[]
        
(Showing Draft Content)

CSJ2K.j2k.io.BufferedRandomAccessFile

BufferedRandomAccessFile Class

Inheritance
BufferedRandomAccessFile
Namespace: CSJ2K.j2k.io
Assembly: C1.WPF.PdfViewer.4.6.2.dll
Syntax
public abstract class BufferedRandomAccessFile : RandomAccessIO, BinaryDataInput, BinaryDataOutput, EndianType

Constructors

Name Description
BufferedRandomAccessFile(object, string)

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

BufferedRandomAccessFile(object, string, int)

Constructor. Always needs a size for the buffer.

BufferedRandomAccessFile(string, string)

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

BufferedRandomAccessFile(string, string, int)

Constructor. Always needs a size for the buffer.

Fields

Name Description
byteBuffer

Buffer of bytes containing the part of the file that is currently being accessed

byteBufferChanged

Boolean keeping track of whether the byte buffer has been changed since it was read.

byte_Ordering
isEOFInBuffer

Whether the end of the file is in the current buffer or not

maxByte

The maximum number of bytes that can be read from the buffer

offset

The current offset of the buffer (which will differ from the offset of the file)

position

The current position in the byte-buffer

Properties

Name Description
ByteOrdering

Returns the endianess (i.e., byte ordering) of the implementing class. Note that an implementing class may implement only one type of endianness or both, which would be decided at creation time.

Pos

Returns the current offset in the file

Methods

Name Description
ToString()

Returns a string of information about the file

close()

Closes the buffered random access file

flush()

Any data that has been buffered must be written (including buffering at the bit level), and the stream should be realigned at the byte level.

length()

Returns the current length of the stream, in bytes, taking into account any buffering.

read()

Reads a byte of data from the stream. Prior to reading, the stream is realigned at the byte level.

readByte()

Reads an unsigned byte of data from the stream. Prior to reading, the stream is realigned at the byte level.

readDouble()

Should read 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()

Should read 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.

readFully(byte[], int, int)

Reads up to len bytes of data from this file into an array of bytes. This method reads repeatedly from the stream until all the bytes are read. This method blocks until all the bytes are read, the end of the stream is detected, or an exception is thrown.

readInt()

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

readLong()

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

readNewBuffer(int)

Reads a new buffer from the file. If there has been any changes made since the buffer was read, the buffer is first written to the file.

readShort()

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

readUnsignedByte()

Should read an unsigned byte (i.e., 8 bit) from the input. It is returned as an int since Java does not have an unsigned byte type. Prior to reading, the input should be realigned at the byte level.

readUnsignedInt()

Should read 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()

Should read 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.

seek(int)

Moves the current position to the given offset at which the next read or write occurs. The offset is measured from the beginning of the stream.

skipBytes(int)

Skips n bytes from the input. Prior to skipping, the input should be realigned at the byte level.

write(byte)

Writes a byte to the stream. Prior to writing, the stream is realigned at the byte level.

write(byte[], int, int)

Writes aan array of bytes to the stream. Prior to writing, the stream is realigned at the byte level.

write(int)

Writes a byte to the stream. Prior to writing, the stream is realigned at the byte level.

writeByte(int)
writeDouble(double)

Should write 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)

Should write 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)

Should write 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)

Should write 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)