Package htsjdk.samtools.cram.io
Class DefaultBitOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- htsjdk.samtools.cram.io.DefaultBitOutputStream
-
- All Implemented Interfaces:
BitOutputStream,Closeable,Flushable,AutoCloseable
public class DefaultBitOutputStream extends OutputStream implements BitOutputStream
-
-
Constructor Summary
Constructors Constructor Description DefaultBitOutputStream(OutputStream delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()StringtoString()voidwrite(boolean bit)Write a single bit specified in the boolean argument.voidwrite(boolean bit, long repeat)Write a single bit specified in the boolean argument repeatedly.voidwrite(byte b)voidwrite(byte[] b)voidwrite(byte[] b, int off, int length)voidwrite(byte bitContainer, int nofBits)Write specified number of bits supplied in the byte value.voidwrite(int value)voidwrite(int bitContainer, int nofBits)Write specified number of bits supplied in the integer value.voidwrite(long bitContainer, int nofBits)Write specified number of bits supplied in the long value.-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
DefaultBitOutputStream
public DefaultBitOutputStream(OutputStream delegate)
-
-
Method Detail
-
write
public void write(byte b) throws IOException- Throws:
IOException
-
write
public void write(int value) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(long bitContainer, int nofBits) throws IOExceptionDescription copied from interface:BitOutputStreamWrite specified number of bits supplied in the long value. The method is naturally limited to 64 bits max.- Specified by:
writein interfaceBitOutputStream- Parameters:
bitContainer- an integer containing the bits to be written outnofBits- the number of bits to written out, minimum 0, maximum 64.- Throws:
IOException- as per streaming contract in java.
-
write
public void write(int bitContainer, int nofBits) throws IOExceptionDescription copied from interface:BitOutputStreamWrite specified number of bits supplied in the integer value. The method is naturally limited to 32 bits max.- Specified by:
writein interfaceBitOutputStream- Parameters:
bitContainer- an integer containing the bits to be written outnofBits- the number of bits to written out, minimum 0, maximum 32.- Throws:
IOException- as per streaming contract in java.
-
write
public void write(byte bitContainer, int nofBits) throws IOExceptionDescription copied from interface:BitOutputStreamWrite specified number of bits supplied in the byte value. The method is naturally limited to 8 bits max.- Specified by:
writein interfaceBitOutputStream- Parameters:
bitContainer- an integer containing the bits to be written outnofBits- the number of bits to written out, minimum 0, maximum 8.- Throws:
IOException- as per streaming contract in java.
-
write
public void write(boolean bit) throws IOExceptionDescription copied from interface:BitOutputStreamWrite a single bit specified in the boolean argument.- Specified by:
writein interfaceBitOutputStream- Parameters:
bit- emit 1 if true, 0 otherwise.- Throws:
IOException- as per streaming contract in java.
-
write
public void write(boolean bit, long repeat) throws IOExceptionDescription copied from interface:BitOutputStreamWrite a single bit specified in the boolean argument repeatedly.- Specified by:
writein interfaceBitOutputStream- Parameters:
bit- emit 1 if true, 0 otherwise.repeat- the number of bits to emit.- Throws:
IOException- as per streaming contract in java.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int length) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
-