BitCodec<byte[]>
public static class ByteArrayStopEncoding.ByteArrayStopCodec extends AbstractBitCodec<byte[]>
Constructor | Description |
---|---|
ByteArrayStopCodec(byte stopByte,
InputStream inputStream,
OutputStream outputStream) |
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
|
readInto, skip, skip
public ByteArrayStopCodec(byte stopByte, InputStream inputStream, OutputStream outputStream)
public byte[] read(BitInputStream bitInputStream) throws IOException
BitCodec
read
in interface BitCodec<byte[]>
read
in class AbstractBitCodec<byte[]>
bitInputStream
- the bit input stream to rad fromIOException
- as per java IO contractpublic byte[] read(BitInputStream bitInputStream, int length) throws IOException
BitCodec
read
in interface BitCodec<byte[]>
read
in class AbstractBitCodec<byte[]>
bitInputStream
- the bit input stream to rad from
param valueLen the number of elements to readIOException
- as per java IO contractpublic long write(BitOutputStream bitOutputStream, byte[] object) throws IOException
BitCodec
write
in interface BitCodec<byte[]>
write
in class AbstractBitCodec<byte[]>
bitOutputStream
- the output bit stream to write toobject
- the object to writeIOException
- as per java IO contractpublic long numberOfBits(byte[] object)
BitCodec
numberOfBits
in interface BitCodec<byte[]>
numberOfBits
in class AbstractBitCodec<byte[]>
object
- an object