org.fuin.serialver4j.base
Class VersioningJavaSerializer

java.lang.Object
  extended by org.fuin.serialver4j.base.VersioningJavaSerializer
All Implemented Interfaces:
VersioningSerializer

public final class VersioningJavaSerializer
extends Object
implements VersioningSerializer

Serializes a given object using a ObjectOutputStream and deserializes and Object using a VersioningObjectInputStream.


Constructor Summary
VersioningJavaSerializer(ClassesHistory history)
          Constructor with history.
 
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

VersioningJavaSerializer

public VersioningJavaSerializer(ClassesHistory history)
Constructor with history.

Parameters:
history - History to use.
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.