Package org.fusesource.hawtbuf.codec
Class StringCodec
- java.lang.Object
-
- org.fusesource.hawtbuf.codec.StringCodec
-
-
Field Summary
Fields Modifier and Type Field Description static StringCodec
INSTANCE
-
Constructor Summary
Constructors Constructor Description StringCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
decode(java.io.DataInput dataIn)
Read the entry from the RawContainerjava.lang.String
deepCopy(java.lang.String source)
void
encode(java.lang.String object, java.io.DataOutput dataOut)
Write the payload of this entry to the RawContainerint
estimatedSize(java.lang.String object)
int
getFixedSize()
boolean
isDeepCopySupported()
boolean
isEstimatedSizeSupported()
-
-
-
Field Detail
-
INSTANCE
public static final StringCodec INSTANCE
-
-
Method Detail
-
encode
public void encode(java.lang.String object, java.io.DataOutput dataOut) throws java.io.IOException
Write the payload of this entry to the RawContainer
-
decode
public java.lang.String decode(java.io.DataInput dataIn) throws java.io.IOException
Read the entry from the RawContainer
-
getFixedSize
public int getFixedSize()
- Specified by:
getFixedSize
in interfaceCodec<java.lang.String>
- Returns:
- -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
-
deepCopy
public java.lang.String deepCopy(java.lang.String source)
-
isDeepCopySupported
public boolean isDeepCopySupported()
- Specified by:
isDeepCopySupported
in interfaceCodec<java.lang.String>
- Returns:
- true if the
Codec.deepCopy(Object)
operations is supported.
-
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()
- Specified by:
isEstimatedSizeSupported
in interfaceCodec<java.lang.String>
- Returns:
- true if the
Codec.estimatedSize(Object)
operation is supported.
-
estimatedSize
public int estimatedSize(java.lang.String object)
- Specified by:
estimatedSize
in interfaceCodec<java.lang.String>
- Returns:
- the estimated marshaled size of the object.
-
-