Package org.fusesource.hawtbuf.codec
Class FixedBufferCodec
- java.lang.Object
-
- org.fusesource.hawtbuf.codec.FixedBufferCodec
-
-
Field Summary
Fields Modifier and Type Field Description private intsize
-
Constructor Summary
Constructors Constructor Description FixedBufferCodec(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bufferdecode(java.io.DataInput dataIn)Read the payload of the object from the DataInput stream.BufferdeepCopy(Buffer source)voidencode(Buffer value, java.io.DataOutput dataOut)Write the payload of the object to the DataOutput stream.intestimatedSize(Buffer object)intgetFixedSize()booleanisDeepCopySupported()booleanisEstimatedSizeSupported()
-
-
-
Method Detail
-
encode
public void encode(Buffer value, java.io.DataOutput dataOut) throws java.io.IOException
Description copied from interface:CodecWrite the payload of the object to the DataOutput stream.
-
decode
public Buffer decode(java.io.DataInput dataIn) throws java.io.IOException
Description copied from interface:CodecRead the payload of the object from the DataInput stream.
-
getFixedSize
public int getFixedSize()
- Specified by:
getFixedSizein interfaceCodec<Buffer>- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
isDeepCopySupported
public boolean isDeepCopySupported()
- Specified by:
isDeepCopySupportedin interfaceCodec<Buffer>- Returns:
- true if the
Codec.deepCopy(Object)operations is supported.
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()
- Specified by:
isEstimatedSizeSupportedin interfaceCodec<Buffer>- Returns:
- true if the
Codec.estimatedSize(Object)operation is supported.
-
estimatedSize
public int estimatedSize(Buffer object)
- Specified by:
estimatedSizein interfaceCodec<Buffer>- Returns:
- the estimated marshaled size of the object.
-
-