org.jfree.io
Class SerialUtilities

java.lang.Object
  |
  +--org.jfree.io.SerialUtilities

public class SerialUtilities
extends java.lang.Object

A class containing useful utility methods relating to serialization.

Author:
David Gilbert

Constructor Summary
protected SerialUtilities()
          To prevent unnecessary instantiation.
 
Method Summary
static java.awt.Paint readPaint(java.io.ObjectInputStream stream)
          Reads a Paint object that has been serialised by the writePaint(java.awt.Paint, java.io.ObjectOutputStream) method.
static java.awt.Shape readShape(java.io.ObjectInputStream stream)
          Reads a Shape object that has been serialised by the writeShape(java.awt.Shape, java.io.ObjectOutputStream) method.
static java.awt.Stroke readStroke(java.io.ObjectInputStream stream)
          Reads a Stroke object that has been serialised by the writeStroke(java.awt.Stroke, java.io.ObjectOutputStream) method.
static void writePaint(java.awt.Paint paint, java.io.ObjectOutputStream stream)
          Serialises a Paint object.
static void writeShape(java.awt.Shape shape, java.io.ObjectOutputStream stream)
          Serialises a Shape object.
static void writeStroke(java.awt.Stroke stroke, java.io.ObjectOutputStream stream)
          Serialises a Stroke object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialUtilities

protected SerialUtilities()
To prevent unnecessary instantiation.

Method Detail

readPaint

public static java.awt.Paint readPaint(java.io.ObjectInputStream stream)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException
Reads a Paint object that has been serialised by the writePaint(java.awt.Paint, java.io.ObjectOutputStream) method.

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

writePaint

public static void writePaint(java.awt.Paint paint,
                              java.io.ObjectOutputStream stream)
                       throws java.io.IOException
Serialises a Paint object.

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

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 serialised 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
Serialises a Stroke object.

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

readShape

public static java.awt.Shape readShape(java.io.ObjectInputStream stream)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException
Reads a Shape object that has been serialised by the writeShape(java.awt.Shape, java.io.ObjectOutputStream) method.

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

writeShape

public static void writeShape(java.awt.Shape shape,
                              java.io.ObjectOutputStream stream)
                       throws java.io.IOException
Serialises a Shape object.

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