Interface Codec<T>
- All Known Implementing Classes:
AbstractBufferCodec, AsciiBufferCodec, BufferCodec, BytesCodec, FixedBufferCodec, IntegerCodec, LongCodec, ObjectCodec, PBMessageFramedCodec, PBMessageUnframedCodec, StringCodec, UTF8BufferCodec, VariableCodec, VarIntegerCodec, VarLongCodec, VarSignedIntegerCodec, VarSignedLongCodec
public interface Codec<T>
-
Method Summary
Modifier and TypeMethodDescriptionRead the payload of the object from the DataInput stream.voidencode(T object, DataOutput dataOut) Write the payload of the object to the DataOutput stream.intestimatedSize(T object) intbooleanboolean
-
Method Details
-
encode
Write the payload of the object to the DataOutput stream.- Parameters:
object-dataOut-- Throws:
IOException
-
decode
Read the payload of the object from the DataInput stream.- Parameters:
dataIn-- Returns:
- unmarshalled object
- Throws:
IOException
-
getFixedSize
int getFixedSize()- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
isEstimatedSizeSupported
boolean isEstimatedSizeSupported()- Returns:
- true if the
estimatedSize(Object)operation is supported.
-
estimatedSize
- Parameters:
object-- Returns:
- the estimated marshaled size of the object.
-
isDeepCopySupported
boolean isDeepCopySupported()- Returns:
- true if the
deepCopy(Object)operations is supported.
-
deepCopy
-