org.fusesource.hawtbuf.codec
Class StringCodec
java.lang.Object
org.fusesource.hawtbuf.codec.StringCodec
- All Implemented Interfaces:
- Codec<java.lang.String>
public class StringCodec
- extends java.lang.Object
- implements Codec<java.lang.String>
Implementation of a Marshaller for Strings
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final StringCodec INSTANCE
StringCodec
public StringCodec()
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
- Specified by:
encode
in interface Codec<java.lang.String>
- Parameters:
object
- dataOut
-
- Throws:
java.io.IOException
decode
public java.lang.String decode(java.io.DataInput dataIn)
throws java.io.IOException
- Read the entry from the RawContainer
- Specified by:
decode
in interface Codec<java.lang.String>
- Parameters:
dataIn
-
- Returns:
- unmarshalled object
- Throws:
java.io.IOException
getFixedSize
public int getFixedSize()
- Specified by:
getFixedSize
in interface Codec<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)
- Specified by:
deepCopy
in interface Codec<java.lang.String>
- Returns:
- a deep copy of the source object. If the source is immutable
the same source should be returned.
isDeepCopySupported
public boolean isDeepCopySupported()
- Specified by:
isDeepCopySupported
in interface Codec<java.lang.String>
- Returns:
- true if the
Codec.deepCopy(Object)
operations is supported.
isEstimatedSizeSupported
public boolean isEstimatedSizeSupported()
- Specified by:
isEstimatedSizeSupported
in interface Codec<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 interface Codec<java.lang.String>
- Returns:
- the estimated marshaled size of the object.
Copyright © 2010-2011 FuseSource, Corp.. All Rights Reserved.