public abstract class AbstractBitCodec<T> extends java.lang.Object implements BitCodec<T>
Constructor and Description |
---|
AbstractBitCodec() |
Modifier and Type | Method and Description |
---|---|
abstract long |
numberOfBits(T object)
Calculate the number of bits that the object would take in bit serialized form.
|
abstract T |
read(BitInputStream bitInputStream)
Read a single object from the bit stream.
|
abstract 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.
|
abstract long |
write(BitOutputStream bitOutputStream,
T object)
Write an object into the bit stream
|
public abstract T read(BitInputStream bitInputStream) throws java.io.IOException
BitCodec
public abstract T read(BitInputStream bitInputStream, int valueLen) throws java.io.IOException
BitCodec
public void readInto(BitInputStream bitInputStream, byte[] array, int offset, int valueLen) throws java.io.IOException
BitCodec
public void skip(BitInputStream bitInputStream) throws java.io.IOException
BitCodec
public void skip(BitInputStream bitInputStream, int length) throws java.io.IOException
BitCodec
public abstract long write(BitOutputStream bitOutputStream, T object) throws java.io.IOException
BitCodec
public abstract long numberOfBits(T object)
BitCodec
numberOfBits
in interface BitCodec<T>
object
- an object