com.googlecode.xremoting.core.xstream
Class XStreamSerializer
java.lang.Object
com.googlecode.xremoting.core.xstream.XStreamSerializer
- All Implemented Interfaces:
- Serializer
public class XStreamSerializer
- extends Object
- implements Serializer
Serializer which uses XStream as a serialization engine. So,
basically, data is converted to XML during the serialization.
This is the default XRemoting serializer.
- Author:
- Roman Puchkovskiy
|
Field Summary |
protected com.thoughtworks.xstream.XStream |
xstream
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
xstream
protected com.thoughtworks.xstream.XStream xstream
XStreamSerializer
public XStreamSerializer()
createXStream
protected com.thoughtworks.xstream.XStream createXStream()
serialize
public void serialize(Object object,
OutputStream os)
throws SerializationException,
IOException
- Description copied from interface:
Serializer
- Serializes an object to an
OutputStream.
- Specified by:
serialize in interface Serializer
- Parameters:
object - object to serializeos - output stream to which to serialize
- Throws:
SerializationException - if something specific to serializer
happened during the serialization
IOException - if input/output error happened
deserialize
public <T> T deserialize(InputStream is)
throws SerializationException,
IOException
- Description copied from interface:
Serializer
- Deserializes an object an
InputStream.
- Specified by:
deserialize in interface Serializer
- Type Parameters:
T - returned type- Parameters:
is - input stream from which to deserialize
- Returns:
- deserialized object
- Throws:
SerializationException - if something specific to serializer
happened during the serialization
IOException - if input/output error happened
createWriter
protected Writer createWriter(OutputStream os)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
createReader
protected Reader createReader(InputStream is)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
getDefaultCharset
protected String getDefaultCharset()
Copyright © 2011. All Rights Reserved.