Package org.fusesource.hawtbuf.codec
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
decode(java.io.DataInput dataIn)
Read the payload of the object from the DataInput stream.T
deepCopy(T source)
void
encode(T object, java.io.DataOutput dataOut)
Write the payload of the object to the DataOutput stream.int
estimatedSize(T object)
int
getFixedSize()
boolean
isDeepCopySupported()
boolean
isEstimatedSizeSupported()
-
-
-
Method Detail
-
encode
void encode(T object, java.io.DataOutput dataOut) throws java.io.IOException
Write the payload of the object to the DataOutput stream.- Parameters:
object
-dataOut
-- Throws:
java.io.IOException
-
decode
T decode(java.io.DataInput dataIn) throws java.io.IOException
Read the payload of the object from the DataInput stream.- Parameters:
dataIn
-- Returns:
- unmarshalled object
- Throws:
java.io.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
int estimatedSize(T object)
- Parameters:
object
-- Returns:
- the estimated marshaled size of the object.
-
isDeepCopySupported
boolean isDeepCopySupported()
- Returns:
- true if the
deepCopy(Object)
operations is supported.
-
-