Class AbstractBufferCodec<T extends Buffer>
java.lang.Object
org.fusesource.hawtbuf.codec.VariableCodec<T>
org.fusesource.hawtbuf.codec.AbstractBufferCodec<T>
- All Implemented Interfaces:
Codec<T>
- Direct Known Subclasses:
AsciiBufferCodec, BufferCodec, UTF8BufferCodec
Implementation of a Codec for Buffer objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TcreateBuffer(byte[] data) Read the payload of the object from the DataInput stream.voidencode(T value, DataOutput dataOut) Write the payload of the object to the DataOutput stream.intestimatedSize(T object) booleanbooleanMethods inherited from class VariableCodec
getFixedSize
-
Constructor Details
-
AbstractBufferCodec
public AbstractBufferCodec()
-
-
Method Details
-
encode
Description copied from interface:CodecWrite the payload of the object to the DataOutput stream.- Parameters:
value-dataOut-- Throws:
IOException
-
decode
Description copied from interface:CodecRead the payload of the object from the DataInput stream.- Parameters:
dataIn-- Returns:
- unmarshalled object
- Throws:
IOException
-
createBuffer
-
deepCopy
-
isDeepCopySupported
public boolean isDeepCopySupported()- Specified by:
isDeepCopySupportedin interfaceCodec<T extends Buffer>- Overrides:
isDeepCopySupportedin classVariableCodec<T extends Buffer>- Returns:
- true if the
Codec.deepCopy(Object)operations is supported.
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()- Specified by:
isEstimatedSizeSupportedin interfaceCodec<T extends Buffer>- Overrides:
isEstimatedSizeSupportedin classVariableCodec<T extends Buffer>- Returns:
- true if the
Codec.estimatedSize(Object)operation is supported.
-
estimatedSize
- Specified by:
estimatedSizein interfaceCodec<T extends Buffer>- Overrides:
estimatedSizein classVariableCodec<T extends Buffer>- Parameters:
object-- Returns:
- the estimated marshaled size of the object.
-