public final class ByteBitInputStream extends java.lang.Object implements BitInputStream
| Constructor and Description |
|---|
ByteBitInputStream(java.io.InputStream in)
Constructs a bit input stream based on the specified byte input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream and the underlying input stream.
|
int |
getBitPosition()
Returns the current bit position, which ascends from 0 to 7 as bits are read.
|
int |
read()
Reads a bit from this stream.
|
int |
readByte()
Discards the remainder of the current byte (if any) and reads the next whole
byte from the stream.
|
int |
readNoEof()
Reads a bit from this stream.
|
public ByteBitInputStream(java.io.InputStream in)
in - the byte input stream (not null)java.lang.NullPointerException - if the input stream is nullpublic int getBitPosition()
BitInputStreamgetBitPosition in interface BitInputStreampublic int readByte()
throws java.io.IOException
BitInputStreamreadByte in interface BitInputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
BitInputStreamread in interface BitInputStreamjava.io.IOException - if an I/O exception occurredpublic int readNoEof()
throws java.io.IOException
BitInputStreamEOFException if the end of stream is reached. The end of stream
always occurs on a byte boundary.readNoEof in interface BitInputStreamjava.io.IOException - if an I/O exception occurredjava.io.EOFException - if the end of stream is reachedpublic void close()
throws java.io.IOException
BitInputStreamclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface BitInputStreamjava.io.IOException - if an I/O exception occurred