public class SerialUtils extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.awt.Paint |
readPaint(java.io.ObjectInputStream stream)
Reads a
Paint object that has been serialized by the
writePaint(Paint, ObjectOutputStream) method. |
static java.awt.Stroke |
readStroke(java.io.ObjectInputStream stream)
Reads a
Stroke object that has been serialized by the
writeStroke(Stroke, ObjectOutputStream) method. |
static void |
writePaint(java.awt.Paint paint,
java.io.ObjectOutputStream stream)
Serializes a
Paint object. |
static void |
writeStroke(java.awt.Stroke stroke,
java.io.ObjectOutputStream stream)
Serializes a
Stroke object. |
public static java.awt.Paint readPaint(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
Paint object that has been serialized by the
writePaint(Paint, ObjectOutputStream) method.stream - the input stream (null not permitted).null).java.io.IOException - if there is an I/O problem.java.lang.ClassNotFoundException - if there is a problem loading a class.public static void writePaint(java.awt.Paint paint, java.io.ObjectOutputStream stream) throws java.io.IOException
Paint object.paint - the paint object (null permitted).stream - the output stream (null not permitted).java.io.IOException - if there is an I/O error.public static java.awt.Stroke readStroke(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
Stroke object that has been serialized by the
writeStroke(Stroke, ObjectOutputStream) method.stream - the input stream (null not permitted).null).java.io.IOException - if there is an I/O problem.java.lang.ClassNotFoundException - if there is a problem loading a class.public static void writeStroke(java.awt.Stroke stroke, java.io.ObjectOutputStream stream) throws java.io.IOException
Stroke object. This code handles the
BasicStroke class which is the only Stroke
implementation provided by the JDK (and isn't directly
Serializable).stroke - the stroke object (null permitted).stream - the output stream (null not permitted).java.io.IOException - if there is an I/O error.