org.fuin.serialver4j.xstream
Class VersioningXStreamSerializer

java.lang.Object
  extended by org.fuin.serialver4j.xstream.VersioningXStreamSerializer
All Implemented Interfaces:
VersioningSerializer

public final class VersioningXStreamSerializer
extends Object
implements VersioningSerializer

Serializes and deserializes a given object using XStream.


Constructor Summary
VersioningXStreamSerializer(ClassesHistory history, com.thoughtworks.xstream.XStream xstream, int pushbackBufSize)
          Constructor with history, xstream and push back buffer size.
 
Method Summary
 Object deserialize(InputStream in)
          Reads an object from the stream and converts old versions of the object into the current representation.
 void serialize(OutputStream out, Object obj)
          Writes the object to the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersioningXStreamSerializer

public VersioningXStreamSerializer(ClassesHistory history,
                                   com.thoughtworks.xstream.XStream xstream,
                                   int pushbackBufSize)
Constructor with history, xstream and push back buffer size.

Parameters:
history - History to use.
xstream - Read initialized XStream instance.
pushbackBufSize - Size of the push back buffer.
Method Detail

deserialize

public final Object deserialize(InputStream in)
                         throws IOException,
                                DeserializationException
Description copied from interface: VersioningSerializer
Reads an object from the stream and converts old versions of the object into the current representation.

Specified by:
deserialize in interface VersioningSerializer
Parameters:
in - Stream to read.
Returns:
Object.
Throws:
IOException - Error reading the stream or the stream contains a wrong format.
DeserializationException - Error deserializing the input to an object.

serialize

public final void serialize(OutputStream out,
                            Object obj)
                     throws IOException
Description copied from interface: VersioningSerializer
Writes the object to the stream.

Specified by:
serialize in interface VersioningSerializer
Parameters:
out - Stream to write to.
obj - Object to serialize.
Throws:
IOException - Error writing to the stream.


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.