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 longnumberOfBits(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.longwrite(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:BitCodecRead a single object from the bit stream.- Specified by:
readin interfaceBitCodec<byte[]>- Specified by:
readin 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:BitCodecRead a array of specified length from the bit stream.- Specified by:
readin interfaceBitCodec<byte[]>- Specified by:
readin 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:BitCodecWrite an object into the bit stream- Specified by:
writein interfaceBitCodec<byte[]>- Specified by:
writein 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:BitCodecCalculate the number of bits that the object would take in bit serialized form.- Specified by:
numberOfBitsin interfaceBitCodec<byte[]>- Specified by:
numberOfBitsin classAbstractBitCodec<byte[]>- Parameters:
object- an object- Returns:
- the number of bits
-
-