org.basex.io
Class DataInput

java.lang.Object
  extended by org.basex.io.BufferInput
      extended by org.basex.io.DataInput

public final class DataInput
extends BufferInput

This is an input stream for project specific data types.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Constructor Summary
DataInput(java.lang.String db, java.lang.String file)
          Initializes the file reader.
 
Method Summary
 long read5()
          Reads an integer value from the input stream.
 boolean readBool()
          Reads a boolean value from the input stream.
 boolean[] readBooleans()
          Reads a boolean array from the input stream.
 byte[] readBytes()
          Reads a byte array from the input stream.
 byte[][] readBytesArray()
          Reads a double byte array from the input stream.
 int readNum()
          Reads and decompresses an integer value from the input stream.
 int[] readNums()
          Reads an integer array from the input stream.
 int[] readNums(int s)
          Reads an integer array with the specified size from the input stream.
 java.lang.String readString()
          Reads a string from the input stream.
 
Methods inherited from class org.basex.io.BufferInput
close, encoding, encoding, length, length, read, read, readByte, readChar, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataInput

public DataInput(java.lang.String db,
                 java.lang.String file)
          throws java.io.IOException
Initializes the file reader.

Parameters:
db - name of the database
file - the file to be read
Throws:
java.io.IOException - IO Exception
Method Detail

readBool

public boolean readBool()
                 throws java.io.IOException
Reads a boolean value from the input stream.

Returns:
boolean value
Throws:
java.io.IOException - IO Exception

readString

public java.lang.String readString()
                            throws java.io.IOException
Reads a string from the input stream.

Returns:
string
Throws:
java.io.IOException - IO Exception

readBytes

public byte[] readBytes()
                 throws java.io.IOException
Reads a byte array from the input stream.

Returns:
byte array
Throws:
java.io.IOException - IO Exception

readNums

public int[] readNums()
               throws java.io.IOException
Reads an integer array from the input stream.

Returns:
integer array
Throws:
java.io.IOException - IO Exception

readNums

public int[] readNums(int s)
               throws java.io.IOException
Reads an integer array with the specified size from the input stream.

Parameters:
s - array size
Returns:
integer array
Throws:
java.io.IOException - IO Exception

readBooleans

public boolean[] readBooleans()
                       throws java.io.IOException
Reads a boolean array from the input stream.

Returns:
boolean array
Throws:
java.io.IOException - IO Exception

readBytesArray

public byte[][] readBytesArray()
                        throws java.io.IOException
Reads a double byte array from the input stream.

Returns:
double array
Throws:
java.io.IOException - IO Exception

readNum

public int readNum()
            throws java.io.IOException
Reads and decompresses an integer value from the input stream.

Returns:
read value
Throws:
java.io.IOException - IO Exception

read5

public long read5()
           throws java.io.IOException
Reads an integer value from the input stream.

Returns:
integer value
Throws:
java.io.IOException - IO Exception