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 null
public int getBitPosition()
BitInputStream
getBitPosition
in interface BitInputStream
public int readByte() throws java.io.IOException
BitInputStream
readByte
in interface BitInputStream
java.io.IOException
public int read() throws java.io.IOException
BitInputStream
read
in interface BitInputStream
java.io.IOException
- if an I/O exception occurredpublic int readNoEof() throws java.io.IOException
BitInputStream
EOFException
if the end of stream is reached. The end of stream always occurs on a byte boundary.readNoEof
in interface BitInputStream
java.io.IOException
- if an I/O exception occurredjava.io.EOFException
- if the end of stream is reachedpublic void close() throws java.io.IOException
BitInputStream
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface BitInputStream
java.io.IOException
- if an I/O exception occurred