Package htsjdk.samtools.cram.encoding
Class ByteArrayStopEncoding.ByteArrayStopCodec
- java.lang.Object
-
- htsjdk.samtools.cram.encoding.AbstractBitCodec<byte[]>
-
- htsjdk.samtools.cram.encoding.ByteArrayStopEncoding.ByteArrayStopCodec
-
- All Implemented Interfaces:
BitCodec<byte[]>
- Enclosing class:
- ByteArrayStopEncoding
public static class ByteArrayStopEncoding.ByteArrayStopCodec extends AbstractBitCodec<byte[]>
-
-
Constructor Summary
Constructors Constructor Description ByteArrayStopCodec(byte stopByte, InputStream inputStream, OutputStream outputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
numberOfBits(byte[] object)
Calculate the number of bits that the object would take in bit serialized form.byte[]
read(BitInputStream bitInputStream)
Read a single object from the bit stream.byte[]
read(BitInputStream bitInputStream, int length)
Read a array of specified length from the bit stream.long
write(BitOutputStream bitOutputStream, byte[] object)
Write an object into the bit stream-
Methods inherited from class htsjdk.samtools.cram.encoding.AbstractBitCodec
readInto, skip, skip
-
-
-
-
Constructor Detail
-
ByteArrayStopCodec
public ByteArrayStopCodec(byte stopByte, InputStream inputStream, OutputStream outputStream)
-
-
Method Detail
-
read
public byte[] read(BitInputStream bitInputStream) throws IOException
Description copied from interface:BitCodec
Read a single object from the bit stream.- Specified by:
read
in interfaceBitCodec<byte[]>
- Specified by:
read
in classAbstractBitCodec<byte[]>
- Parameters:
bitInputStream
- the bit input stream to rad from- Returns:
- an object from the stream
- Throws:
IOException
- as per java IO contract
-
read
public byte[] read(BitInputStream bitInputStream, int length) throws IOException
Description copied from interface:BitCodec
Read a array of specified length from the bit stream.- Specified by:
read
in interfaceBitCodec<byte[]>
- Specified by:
read
in classAbstractBitCodec<byte[]>
- Parameters:
bitInputStream
- the bit input stream to rad from param valueLen the number of elements to read- Returns:
- an object from the stream
- Throws:
IOException
- as per java IO contract
-
write
public long write(BitOutputStream bitOutputStream, byte[] object) throws IOException
Description copied from interface:BitCodec
Write an object into the bit stream- Specified by:
write
in interfaceBitCodec<byte[]>
- Specified by:
write
in classAbstractBitCodec<byte[]>
- Parameters:
bitOutputStream
- the output bit stream to write toobject
- the object to write- Returns:
- the number of bits written out
- Throws:
IOException
- as per java IO contract
-
numberOfBits
public long numberOfBits(byte[] object)
Description copied from interface:BitCodec
Calculate the number of bits that the object would take in bit serialized form.- Specified by:
numberOfBits
in interfaceBitCodec<byte[]>
- Specified by:
numberOfBits
in classAbstractBitCodec<byte[]>
- Parameters:
object
- an object- Returns:
- the number of bits
-
-