info.monitorenter.util
Class SerializationUtility

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

public final class SerializationUtility
extends java.lang.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 java.awt.Stroke readStroke(java.io.ObjectInputStream stream)
          Reads a Stroke object that has been serialized by the writeStroke(java.awt.Stroke, java.io.ObjectOutputStream) method.
static void writeStroke(java.awt.Stroke stroke, java.io.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 java.awt.Stroke readStroke(java.io.ObjectInputStream stream)
                                  throws java.io.IOException,
                                         java.lang.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:
java.io.IOException - if there is an I/O problem.
java.lang.ClassNotFoundException - if there is a problem loading a class.

writeStroke

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

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


Copyright © 2001 - 2010 LGPL, All Rights Footloose.