Class BytesCodec
java.lang.Object
org.fusesource.hawtbuf.codec.BytesCodec
- All Implemented Interfaces:
Codec<byte[]>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Read the payload of the object from the DataInput stream.byte[]deepCopy(byte[] source) voidencode(byte[] data, DataOutput dataOut) Write the payload of the object to the DataOutput stream.intestimatedSize(byte[] object) intbooleanboolean
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
BytesCodec
public BytesCodec()
-
-
Method Details
-
encode
Description copied from interface:CodecWrite the payload of the object to the DataOutput stream.- Specified by:
encodein interfaceCodec<byte[]>- Parameters:
data-dataOut-- Throws:
IOException
-
decode
Description copied from interface:CodecRead the payload of the object from the DataInput stream.- Specified by:
decodein interfaceCodec<byte[]>- Parameters:
dataIn-- Returns:
- unmarshalled object
- Throws:
IOException
-
getFixedSize
public int getFixedSize()- Specified by:
getFixedSizein interfaceCodec<byte[]>- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
deepCopy
-
isDeepCopySupported
public boolean isDeepCopySupported()- Specified by:
isDeepCopySupportedin interfaceCodec<byte[]>- Returns:
- true if the
Codec.deepCopy(Object)operations is supported.
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()- Specified by:
isEstimatedSizeSupportedin interfaceCodec<byte[]>- Returns:
- true if the
Codec.estimatedSize(Object)operation is supported.
-
estimatedSize
public int estimatedSize(byte[] object) - Specified by:
estimatedSizein interfaceCodec<byte[]>- Parameters:
object-- Returns:
- the estimated marshaled size of the object.
-