pivot.wtk.text
Class PlainTextSerializer
java.lang.Object
pivot.wtk.text.PlainTextSerializer
- All Implemented Interfaces:
- Serializer<Document>
public class PlainTextSerializer
- extends java.lang.Object
- implements Serializer<Document>
Implementation of the Serializer
interface that reads and writes
a plain text document.
- Author:
- gbrown
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MIME_TYPE
public static final java.lang.String MIME_TYPE
- See Also:
- Constant Field Values
BUFFER_SIZE
public static final int BUFFER_SIZE
- See Also:
- Constant Field Values
PlainTextSerializer
public PlainTextSerializer()
PlainTextSerializer
public PlainTextSerializer(java.lang.String charsetName)
PlainTextSerializer
public PlainTextSerializer(java.nio.charset.Charset charset)
readObject
public Document readObject(java.io.InputStream inputStream)
throws java.io.IOException,
SerializationException
- Description copied from interface:
Serializer
- Reads an object from an input stream.
- Specified by:
readObject
in interface Serializer<Document>
- Parameters:
inputStream
- The data stream from which the object will be read.
- Returns:
- The deserialized object.
- Throws:
java.io.IOException
SerializationException
readObject
public Document readObject(java.io.Reader reader)
throws java.io.IOException,
SerializationException
- Throws:
java.io.IOException
SerializationException
writeObject
public void writeObject(Document document,
java.io.OutputStream outputStream)
throws java.io.IOException,
SerializationException
- Description copied from interface:
Serializer
- Writes an object to an output stream.
- Specified by:
writeObject
in interface Serializer<Document>
- Parameters:
document
- The object to serialize.outputStream
- The data stream to which the object will be written.
- Throws:
java.io.IOException
SerializationException
writeObject
public void writeObject(Document document,
java.io.Writer writer)
throws java.io.IOException,
SerializationException
- Throws:
java.io.IOException
SerializationException
getMIMEType
public java.lang.String getMIMEType(Document document)
- Description copied from interface:
Serializer
- Returns the MIME type of the data read and written by this serializer.
- Specified by:
getMIMEType
in interface Serializer<Document>
- Parameters:
document
- If provided, allows the serializer to attach parameters to the returned
MIME type containing more detailed information about the data. If
null, the base MIME type is returned.