ch.javasoft.jbase.marshal
Class StringMarshaller

java.lang.Object
  extended by ch.javasoft.jbase.marshal.StringMarshaller
All Implemented Interfaces:
EntityMarshaller<String>

public class StringMarshaller
extends Object
implements EntityMarshaller<String>

A StringMarshaller is a marshaller for strings, not necessarily encoded with UTF characters. You might also consider using UtfStringMarshaller for UTF strings.

The string marshaller can be used with a VariableWidthTable.


Field Summary
static StringMarshaller INSTANCE
          The default instance
 
Constructor Summary
StringMarshaller()
           
 
Method Summary
 String readFrom(DataInput in)
          Reads from the given data input and creates an entity instance from the read data
 void writeTo(String entity, DataOutput out)
          Writes the given entity to the given data output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final StringMarshaller INSTANCE
The default instance

Constructor Detail

StringMarshaller

public StringMarshaller()
Method Detail

writeTo

public void writeTo(String entity,
                    DataOutput out)
             throws IOException
Description copied from interface: EntityMarshaller
Writes the given entity to the given data output

Specified by:
writeTo in interface EntityMarshaller<String>
Throws:
IOException

readFrom

public String readFrom(DataInput in)
                throws IOException
Description copied from interface: EntityMarshaller
Reads from the given data input and creates an entity instance from the read data

Specified by:
readFrom in interface EntityMarshaller<String>
Throws:
IOException