info.monitorenter.util
Class SerializationUtility

java.lang.Object
  extended by info.monitorenter.util.SerializationUtility

public final class SerializationUtility
extends Object

A class containing useful utility methods relating to serialization.

This is originally inspired (serialization of trokes) by jfreechart.

Version:
$Revision: 1.6 $
Author:
David Gilbert (original), Achim Westermann

Method Summary
static Stroke readStroke(ObjectInputStream stream)
          Reads a Stroke object that has been serialized by the writeStroke(java.awt.Stroke, java.io.ObjectOutputStream) method.
static void writeStroke(Stroke stroke, ObjectOutputStream stream)
          Serializes a Stroke object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readStroke

public static Stroke readStroke(ObjectInputStream stream)
                         throws IOException,
                                ClassNotFoundException
Reads a Stroke object that has been serialized by the writeStroke(java.awt.Stroke, java.io.ObjectOutputStream) method.

Parameters:
stream - the input stream.
Returns:
The stroke object.
Throws:
IOException - if there is an I/O problem.
ClassNotFoundException - if there is a problem loading a class.

writeStroke

public static void writeStroke(Stroke stroke,
                               ObjectOutputStream stream)
                        throws IOException
Serializes a Stroke object.

Parameters:
stroke - the stroke object.
stream - the output stream.
Throws:
IOException - if there is an I/O error.


Copyright © 2001 - 2010 LGPL, All Rights Footloose.