org.apache.kahadb.util
Class StringMarshaller
java.lang.Object
org.apache.kahadb.util.StringMarshaller
- All Implemented Interfaces:
- Marshaller<java.lang.String>
public class StringMarshaller
- extends java.lang.Object
- implements Marshaller<java.lang.String>
Implementation of a Marshaller for Strings
Method Summary |
java.lang.String |
deepCopy(java.lang.String source)
|
int |
getFixedSize()
|
boolean |
isDeepCopySupported()
|
java.lang.String |
readPayload(java.io.DataInput dataIn)
Read the entry from the RawContainer |
void |
writePayload(java.lang.String object,
java.io.DataOutput dataOut)
Write the payload of this entry to the RawContainer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final StringMarshaller INSTANCE
StringMarshaller
public StringMarshaller()
writePayload
public void writePayload(java.lang.String object,
java.io.DataOutput dataOut)
throws java.io.IOException
- Write the payload of this entry to the RawContainer
- Specified by:
writePayload
in interface Marshaller<java.lang.String>
- Parameters:
object
- dataOut
-
- Throws:
java.io.IOException
readPayload
public java.lang.String readPayload(java.io.DataInput dataIn)
throws java.io.IOException
- Read the entry from the RawContainer
- Specified by:
readPayload
in interface Marshaller<java.lang.String>
- Parameters:
dataIn
-
- Returns:
- unmarshalled object
- Throws:
java.io.IOException
getFixedSize
public int getFixedSize()
- Specified by:
getFixedSize
in interface Marshaller<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 Marshaller<java.lang.String>
- Returns:
- a deep copy of the source object.
isDeepCopySupported
public boolean isDeepCopySupported()
- Specified by:
isDeepCopySupported
in interface Marshaller<java.lang.String>
- Returns:
- true if the
Marshaller.deepCopy(Object)
operations is supported.
Copyright © 2005-2012. All Rights Reserved.