org.prevayler.foundation.serialization
Class JavaSerializer

java.lang.Object
  extended by org.prevayler.foundation.serialization.JavaSerializer
All Implemented Interfaces:
Serializer

public class JavaSerializer
extends Object
implements Serializer

Writes and reads objects using Java serialization. This serializer can be used for snapshots, journals or both.


Constructor Summary
JavaSerializer()
           
JavaSerializer(ClassLoader loader)
           
 
Method Summary
 Object readObject(InputStream stream)
          Read an object from a stream.
 void writeObject(OutputStream stream, Object object)
          Write an object to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSerializer

public JavaSerializer()

JavaSerializer

public JavaSerializer(ClassLoader loader)
Method Detail

writeObject

public void writeObject(OutputStream stream,
                        Object object)
                 throws IOException
Description copied from interface: Serializer
Write an object to a stream. An implementation must ensure that the object is written completely before returning. An implementation is free to flush or close the given stream as it sees fit, but is not required to do either. An implementation can expect that the stream is already buffered, so additional buffering is not required for performance.

Specified by:
writeObject in interface Serializer
Throws:
IOException

readObject

public Object readObject(InputStream stream)
                  throws IOException,
                         ClassNotFoundException
Description copied from interface: Serializer
Read an object from a stream. An implementation is free to close the given stream as it sees fit, but is not required to do so. An implementation can expect that the stream is already buffered, so additional buffering is not required for performance.

Specified by:
readObject in interface Serializer
Throws:
IOException
ClassNotFoundException


Copyright © 2001-2013. All Rights Reserved.