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