diff options
Diffstat (limited to 'tutorial/examples/serialize/ColoredPoint.oj')
-rw-r--r-- | tutorial/examples/serialize/ColoredPoint.oj | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tutorial/examples/serialize/ColoredPoint.oj b/tutorial/examples/serialize/ColoredPoint.oj new file mode 100644 index 0000000..30e534c --- /dev/null +++ b/tutorial/examples/serialize/ColoredPoint.oj @@ -0,0 +1,28 @@ +package examples.serialize;
+
+import java.io.*;
+
+public class ColoredPoint
+{
+ public Color color = new Color((byte) 0, (byte) 0, (byte) 0);
+ public Point point = new Point();
+}
+
+/*
+public class ColoredPoint implements Marshalable
+{
+ public Color color = new Color((byte) 1, (byte) 3, (byte) 5);
+ public Point point = new Point();
+
+ public void writeObject(ObjectOut os) throws IOException {
+ os.writeUTF("ColoredPoint");
+ os.writeObject(color);
+ os.writeObject(point);
+ }
+
+ public void readObject(ObjectIn is) throws IOException {
+ color = (Color) is.readObject();
+ point = (Point) is.readObject();
+ }
+}
+*/
|