T
- data series type to be read or writtenAbstractBitCodec
, ByteArrayStopEncoding.ByteArrayStopCodec
public interface BitCodec<T>
Modifier and Type | Method | Description |
---|---|---|
long |
numberOfBits(T object) |
Calculate the number of bits that the object would take in bit serialized form.
|
T |
read(BitInputStream bitInputStream) |
Read a single object from the bit stream.
|
T |
read(BitInputStream bitInputStream,
int valueLen) |
Read a array of specified length from the bit stream.
|
void |
readInto(BitInputStream bitInputStream,
byte[] array,
int offset,
int valueLen) |
Read a array of specified length from the bit stream into a given byte array.
|
void |
skip(BitInputStream bitInputStream) |
Skip the next object in the bit stream.
|
void |
skip(BitInputStream bitInputStream,
int length) |
Skip the next length objects in the bit stream.
|
long |
write(BitOutputStream bitOutputStream,
T object) |
Write an object into the bit stream
|
T read(BitInputStream bitInputStream) throws IOException
bitInputStream
- the bit input stream to rad fromIOException
- as per java IO contractT read(BitInputStream bitInputStream, int valueLen) throws IOException
bitInputStream
- the bit input stream to rad from
param valueLen the number of elements to readIOException
- as per java IO contractvoid readInto(BitInputStream bitInputStream, byte[] array, int offset, int valueLen) throws IOException
bitInputStream
- the bit input stream to rad fromarray
- the array to read intooffset
- offset in the arrayvalueLen
- number of elements to readIOException
- as per java IO contractvoid skip(BitInputStream bitInputStream) throws IOException
bitInputStream
- the bit stream to operate onIOException
- as per java IO contractvoid skip(BitInputStream bitInputStream, int length) throws IOException
bitInputStream
- the bit stream to operate onlength
- the number of objects to skipIOException
- as per java IO contractlong write(BitOutputStream bitOutputStream, T object) throws IOException
bitOutputStream
- the output bit stream to write toobject
- the object to writeIOException
- as per java IO contractlong numberOfBits(T object)
object
- an object