org.icepdf.core.io
Class BitStream

java.lang.Object
  extended by org.icepdf.core.io.BitStream

public class BitStream
extends java.lang.Object

The class BitStream is designed to convert an input stream of bytes into bits. A BitStream is primarily used when bit manipulation of stream needed, such as when bit data is needed for encoding a image.

Since:
1.0

Constructor Summary
BitStream(java.io.InputStream i)
          Create a new instance of a BitStream from the given input stream.
BitStream(java.io.OutputStream o)
          Create a new instance of a BitStream from the given output stream.
 
Method Summary
 boolean atEndOfFile()
           
 int available()
           
 void close()
          Close all streams data associated with this object
 int getBits(int i)
           
 void putBit(int i)
           
 void putRunBits(int i, int len)
           
 void skipByte()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitStream

public BitStream(java.io.InputStream i)
Create a new instance of a BitStream from the given input stream.

Parameters:
i - input stream to create a bit stream from.

BitStream

public BitStream(java.io.OutputStream o)
Create a new instance of a BitStream from the given output stream.

Parameters:
o - output stream to create a bit stream from.
Method Detail

close

public void close()
           throws java.io.IOException
Close all streams data associated with this object

Throws:
java.io.IOException - error closing stream

getBits

public int getBits(int i)
            throws java.io.IOException
Parameters:
i -
Returns:
Throws:
java.io.IOException

atEndOfFile

public boolean atEndOfFile()

putBit

public void putBit(int i)
            throws java.io.IOException
Parameters:
i -
Throws:
java.io.IOException

putRunBits

public void putRunBits(int i,
                       int len)
                throws java.io.IOException
Parameters:
i -
len -
Throws:
java.io.IOException

available

public int available()
              throws java.io.IOException
Returns:
Throws:
java.io.IOException

skipByte

public void skipByte()
              throws java.io.IOException
Throws:
java.io.IOException