public class BitStream
extends java.lang.Object
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.| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
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() |
public BitStream(java.io.InputStream i)
BitStream from the given
input stream.i - input stream to create a bit stream from.public BitStream(java.io.OutputStream o)
BitStream from the given
output stream.o - output stream to create a bit stream from.public void close()
throws java.io.IOException
java.io.IOException - error closing streampublic int getBits(int i)
throws java.io.IOException
i - java.io.IOExceptionpublic boolean atEndOfFile()
public void putBit(int i)
throws java.io.IOException
i - java.io.IOExceptionpublic void putRunBits(int i,
int len)
throws java.io.IOException
i - len - java.io.IOExceptionpublic int available()
throws java.io.IOException
java.io.IOExceptionpublic void skipByte()
throws java.io.IOException
java.io.IOException