Class ByteArrayStopCodec
- java.lang.Object
-
- htsjdk.samtools.cram.encoding.external.ExternalCodec<byte[]>
-
- htsjdk.samtools.cram.encoding.external.ByteArrayStopCodec
-
- All Implemented Interfaces:
CRAMCodec<byte[]>
public class ByteArrayStopCodec extends ExternalCodec<byte[]>
Encode byte arrays by specifying a stop byte to separate the arrays. This cannot be a byte that appears in the data.
-
-
Field Summary
-
Fields inherited from class htsjdk.samtools.cram.encoding.external.ExternalCodec
inputStream, outputStream
-
-
Constructor Summary
Constructors Constructor Description ByteArrayStopCodec(ByteArrayInputStream inputStream, ByteArrayOutputStream outputStream, byte stopByte)Construct a Byte Array Stop Codec
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]read()Read a single object from the streambyte[]read(int length)Read a array of specified length from the streamvoidwrite(byte[] value)Write an object to the stream
-
-
-
Constructor Detail
-
ByteArrayStopCodec
public ByteArrayStopCodec(ByteArrayInputStream inputStream, ByteArrayOutputStream outputStream, byte stopByte)
Construct a Byte Array Stop Codec- Parameters:
inputStream- the input bytestream to read fromoutputStream- the output bytestream to write tostopByte- the byte used to mark array boundaries
-
-
Method Detail
-
read
public byte[] read()
Description copied from interface:CRAMCodecRead a single object from the stream- Returns:
- an object from the stream
-
read
public byte[] read(int length)
Description copied from interface:CRAMCodecRead a array of specified length from the stream- Parameters:
length- the number of elements to read- Returns:
- an object from the stream
-
write
public void write(byte[] value)
Description copied from interface:CRAMCodecWrite an object to the stream- Parameters:
value- the object to write
-
-