org.extex.util.file.random
Interface RandomAccessR

All Superinterfaces:
java.io.DataInput
All Known Implementing Classes:
RandomAccessInputArray, RandomAccessInputFile, RandomAccessInputFileDebug, RandomAccessInputStream

public interface RandomAccessR
extends java.io.DataInput

Interface for random access (read only)

Version:
$Revision: 5921 $
Author:
Michael Niedermair

Field Summary
static int KILL32
          kill the highest 8 bit (by a 32 bit int)
static int X24
          get bit 24
 
Method Summary
 void close()
           
 byte[] getData()
          Returns the data.
 long getPointer()
          Returns the pointer in the buffer.
 boolean isEOF()
          Check, if EOF is reached.
 long length()
           
 int readByteAsInt()
          Reads a byte of data from this file.
 int readInt16()
          Reads a int with 16 bit (2x8).
 int readInt24()
          Reads a int with 24 bit (3x8).
 int readInt8()
          Reads a int with 8 bit (1x8).
 int readSignInt24()
          Reads a sign int with 24 bit (3x8).
 void seek(long arg0)
           
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Field Detail

KILL32

static final int KILL32
kill the highest 8 bit (by a 32 bit int)

See Also:
Constant Field Values

X24

static final int X24
get bit 24

See Also:
Constant Field Values
Method Detail

close

void close()
           throws java.io.IOException
Throws:
java.io.IOException
See Also:
RandomAccessFile.close()

getData

byte[] getData()
               throws java.io.IOException
Returns the data.

Returns:
the data.
Throws:
java.io.IOException

getPointer

long getPointer()
                throws java.io.IOException
Returns the pointer in the buffer.

Returns:
Returns the pointer in the buffer
Throws:
java.io.IOException - if an IO error occurs

isEOF

boolean isEOF()
              throws java.io.IOException
Check, if EOF is reached.

Returns:
Returns true, if EOF is reached.
Throws:
java.io.IOException - if an IO error occurs.

length

long length()
            throws java.io.IOException
Throws:
java.io.IOException
See Also:
RandomAccessFile.length()

readByteAsInt

int readByteAsInt()
                  throws java.io.IOException
Reads a byte of data from this file. The byte is returned as an integer in the range 0 to 255 (0x00-0x0ff).

Returns:
the next byte of data.
Throws:
java.io.IOException - if an IO error occurs.

readInt16

int readInt16()
              throws java.io.IOException
Reads a int with 16 bit (2x8).

Returns:
Returns a int value.
Throws:
java.io.IOException - if an IO error occurs.

readInt24

int readInt24()
              throws java.io.IOException
Reads a int with 24 bit (3x8).

Returns:
Returns a int value.
Throws:
java.io.IOException - if an IO error occurs.

readInt8

int readInt8()
             throws java.io.IOException
Reads a int with 8 bit (1x8).

Returns:
Returns a int value.
Throws:
java.io.IOException - if an IO error occurs.

readSignInt24

int readSignInt24()
                  throws java.io.IOException
Reads a sign int with 24 bit (3x8). The sign is calculated with the b-complement.

Returns:
Returns a int value.
Throws:
java.io.IOException - if an IO error occurs.

seek

void seek(long arg0)
          throws java.io.IOException
Throws:
java.io.IOException
See Also:
RandomAccessFile.seek(long)