org.egothor.io
Interface DataInput

All Known Implementing Classes:
DataInputOutputStream, DataInputStream, GZipInputStream, MemoryInputStream

public interface DataInput

This class is part of the Egothor Project

Author:
Leo Galambos

Method Summary
 int directRead(long from, byte[] arr)
          Read from the offset position without buffering.
 long getFilePointer()
          Gets the filePointer attribute of the DataInput object
 long getMarkPointer()
          Returns the offset of the mark if any, else returns 0.
 void jump()
           
 long length()
          Description of the Method
 void mark(long skip)
          Denote position at getFilePointer+skip for jump().
 int read(byte[] arr, int offset, int max_len)
           
 boolean readBoolean()
           
 byte readByte()
          Description of the Method
 int readFully(byte[] arr)
           
 int readInt()
          Description of the Method
 long readLong()
          Description of the Method
 long readPack7()
          Read a next long stored in a pack-7bit coding.
 int readPack7I()
          Read a next integer stored in a pack-7bit coding.
 int readShort()
          Description of the Method
 java.lang.String readString()
          Description of the Method
 java.lang.StringBuilder readString(java.lang.StringBuilder in)
          Read a next word which is saved in the prefix coding.
 void seek(long pos)
          Description of the Method
 void skipBytes(long gap)
          Description of the Method
 void skipPack7()
           
 void skipPack7I()
           
 

Method Detail

readFully

int readFully(byte[] arr)
              throws java.io.IOException
Parameters:
arr - Description of the Parameter
Returns:
number of bytes read
Throws:
java.io.IOException - Description of the Exception

read

int read(byte[] arr,
         int offset,
         int max_len)
         throws java.io.IOException
Parameters:
arr - Description of the Parameter
max_len - Description of the Parameter
Returns:
number of bytes read
Throws:
java.io.IOException - Description of the Exception

directRead

int directRead(long from,
               byte[] arr)
               throws java.io.IOException
Read from the offset position without buffering. This operation moves the read head which may collide with buffered methods.

Throws:
java.io.IOException

readByte

byte readByte()
              throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readLong

long readLong()
              throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readInt

int readInt()
            throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readShort

int readShort()
              throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

seek

void seek(long pos)
          throws java.io.IOException
Description of the Method

Parameters:
pos - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

getFilePointer

long getFilePointer()
                    throws java.io.IOException
Gets the filePointer attribute of the DataInput object

Returns:
The filePointer value
Throws:
java.io.IOException - Description of the Exception

skipBytes

void skipBytes(long gap)
               throws java.io.IOException
Description of the Method

Parameters:
gap - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

length

long length()
            throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

mark

void mark(long skip)
Denote position at getFilePointer+skip for jump().


getMarkPointer

long getMarkPointer()
Returns the offset of the mark if any, else returns 0.


jump

void jump()
          throws java.io.IOException
Throws:
java.io.IOException

readPack7

long readPack7()
               throws java.io.IOException
Read a next long stored in a pack-7bit coding.

Returns:
the long
Throws:
java.io.IOException - if an I/O error occurs

readString

java.lang.StringBuilder readString(java.lang.StringBuilder in)
                                   throws java.io.IOException
Read a next word which is saved in the prefix coding. This routine can demage the parameter even if the method fails.

Parameters:
in - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readString

java.lang.String readString()
                            throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readPack7I

int readPack7I()
               throws java.io.IOException
Read a next integer stored in a pack-7bit coding.

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

skipPack7I

void skipPack7I()
                throws java.io.IOException
Throws:
java.io.IOException

skipPack7

void skipPack7()
               throws java.io.IOException
Throws:
java.io.IOException

readBoolean

boolean readBoolean()
                    throws java.io.IOException
Throws:
java.io.IOException