korat.utils.io
Interface IBitReader

All Known Implementing Classes:
BitInputStream, BitRandomAccessFile

public interface IBitReader

Interface for reading bits (e.g. from InputStream, RandomFileAccess etc.)

Author:
Aleksandar Milicevic

Method Summary
 int readBitsAsInt(int numOfBits)
          Reads the given number of bits and interprets them as int.
 long readBitsAsLong(int numOfBits)
          Reads the given number of bits and interprets them as long
 double readDouble()
          Reads 64 bits and interprets them as double.
 float readFloat()
          Reads 32 bits and interprets them as float.
 int readInt()
          Reads 32 bits and interprets them as int.
 long readLong()
          Reads 64 bits and interprets them as long.
 

Method Detail

readBitsAsLong

long readBitsAsLong(int numOfBits)
                    throws IOException
Reads the given number of bits and interprets them as long

Parameters:
numOfBits - number of bits to read. Has to be in the range from 1 to 64.
Returns:
value of the read bits interpreted as long.
Throws:
IOException - if an I/O error occurs.

readBitsAsInt

int readBitsAsInt(int numOfBits)
                  throws IOException
Reads the given number of bits and interprets them as int.

Parameters:
numOfBits - number of bits to read. Has to be in the range from 1 to 31.
Returns:
value of the read bits interpreted as int.
Throws:
IOException - if an I/O error occurs.

readInt

int readInt()
            throws IOException
Reads 32 bits and interprets them as int.

Returns:
value of 32 read bits interpreted as int.
Throws:
IOException - if an I/O error occurs.

readLong

long readLong()
              throws IOException
Reads 64 bits and interprets them as long.

Returns:
value of 64 read bits interpreted as long.
Throws:
IOException - if an I/O error occurs.

readFloat

float readFloat()
                throws IOException
Reads 32 bits and interprets them as float.

Returns:
value of 32 read bits interpreted as float.
Throws:
IOException - if an I/O error occurs.

readDouble

double readDouble()
                  throws IOException
Reads 64 bits and interprets them as double.

Returns:
value of 64 read bits interpreted as double.
Throws:
IOException - if an I/O error occurs.