Package htsjdk.samtools.cram.io
Class DefaultBitInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.DataInputStream
-
- htsjdk.samtools.cram.io.DefaultBitInputStream
-
- All Implemented Interfaces:
BitInputStream,Closeable,DataInput,AutoCloseable
public class DefaultBitInputStream extends DataInputStream implements BitInputStream
Must not read from delegate unless no bits left in the buffer!!!
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description DefaultBitInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanreadBit()Reads a single bit from the stream.intreadBits(int n)Read specified number of bits from the stream.longreadLongBits(int n)Read specified number of bits from the stream.voidreset()-
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
DefaultBitInputStream
public DefaultBitInputStream(InputStream in)
-
-
Method Detail
-
readBit
public final boolean readBit() throws IOExceptionDescription copied from interface:BitInputStreamReads a single bit from the stream.- Specified by:
readBitin interfaceBitInputStream- Throws:
IOException- as per streaming contract in java.
-
readBits
public final int readBits(int n) throws IOExceptionDescription copied from interface:BitInputStreamRead specified number of bits from the stream. The bits are return in an integer value.- Specified by:
readBitsin interfaceBitInputStream- Parameters:
n- number of bits to read- Throws:
IOException- as per streaming contract in java.
-
readLongBits
public final long readLongBits(int n) throws IOExceptionDescription copied from interface:BitInputStreamRead specified number of bits from the stream. The bits are return in a long value.- Specified by:
readLongBitsin interfaceBitInputStream- Parameters:
n- number of bits to read- Throws:
IOException- as per streaming contract in java.
-
reset
public void reset()
- Overrides:
resetin classFilterInputStream
-
-