Package org.fusesource.hawtbuf.codec
Class StringCodec
java.lang.Object
org.fusesource.hawtbuf.codec.StringCodec
Implementation of a Marshaller for Strings
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRead the entry from the RawContainervoid
encode
(String object, DataOutput dataOut) Write the payload of this entry to the RawContainerint
estimatedSize
(String object) int
boolean
boolean
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
StringCodec
public StringCodec()
-
-
Method Details
-
encode
Write the payload of this entry to the RawContainer- Specified by:
encode
in interfaceCodec<String>
- Parameters:
object
-dataOut
-- Throws:
IOException
-
decode
Read the entry from the RawContainer- Specified by:
decode
in interfaceCodec<String>
- Parameters:
dataIn
-- Returns:
- unmarshalled object
- Throws:
IOException
-
getFixedSize
public int getFixedSize()- Specified by:
getFixedSize
in interfaceCodec<String>
- 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:
isDeepCopySupported
in interfaceCodec<String>
- Returns:
- true if the
Codec.deepCopy(Object)
operations is supported.
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()- Specified by:
isEstimatedSizeSupported
in interfaceCodec<String>
- Returns:
- true if the
Codec.estimatedSize(Object)
operation is supported.
-
estimatedSize
- Specified by:
estimatedSize
in interfaceCodec<String>
- Parameters:
object
-- Returns:
- the estimated marshaled size of the object.
-