hu.netmind.util
Class LSBDataInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by hu.netmind.util.LSBDataInputStream
All Implemented Interfaces:
java.io.Closeable

public class LSBDataInputStream
extends java.io.InputStream

This class reads data in LSB ordering.


Constructor Summary
LSBDataInputStream(java.io.InputStream input)
          Construct with a psysical input stream.
 
Method Summary
 int available()
          Proxy call to input stream.
 void close()
          Close physical input stream.
 int read()
          Proxy call to input stream.
 byte readByte()
          Read a single byte.
 void readFully(byte[] b)
          Read a buffer fully.
 void readFully(byte[] b, int offset, int length)
          Read a buffer fully.
 int readInt()
          Read an integer from stream.
 long readLong()
          Read a long from stream.
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSBDataInputStream

public LSBDataInputStream(java.io.InputStream input)
Construct with a psysical input stream.

Parameters:
input - The psysical input stream.
Method Detail

close

public void close()
           throws java.io.IOException
Close physical input stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException - If an I/O error occurs.

available

public int available()
              throws java.io.IOException
Proxy call to input stream.

Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException - If an I/O error occurs.

read

public int read()
         throws java.io.IOException
Proxy call to input stream.

Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException - If an I/O error occurs.

readInt

public int readInt()
            throws java.io.IOException
Read an integer from stream.

Returns:
An integer read.
Throws:
java.io.IOException - If an I/O error occurs.
java.io.EOFException - If eof reached during read.

readLong

public long readLong()
              throws java.io.IOException
Read a long from stream.

Returns:
A long read.
Throws:
java.io.IOException - If an I/O error occurs.
java.io.EOFException - If eof reached during read.

readByte

public byte readByte()
              throws java.io.IOException
Read a single byte.

Returns:
The byte read.
Throws:
java.io.IOException - If an I/O error occurs.
java.io.EOFException - If eof reached during read.

readFully

public void readFully(byte[] b,
                      int offset,
                      int length)
               throws java.io.IOException
Read a buffer fully.

Parameters:
b - The array to use.
offset - The offset to start reading.
length - Maximum bytes to read.
Throws:
java.io.IOException - If an I/O error occurs.
java.io.EOFException - If eof reached during read.

readFully

public void readFully(byte[] b)
               throws java.io.IOException
Read a buffer fully.

Parameters:
b - The array to use.
Throws:
java.io.IOException - If an I/O error occurs.
java.io.EOFException - If eof reached during read.