Yurttas/PL/OOL/Java/F/06/03/01/DataB.java
Jump to navigation
Jump to search
1/**
2 * Copyright(C) 1998
3 * All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4 *
5 * Permission to use, copy, modify, and distribute this
6 * software and its documentation for EDUCATIONAL purposes
7 * and withoOS fee is hereby granted provided that this
8 * copyright notice appears in all copies.
9 *
10 * @date : January 1, 1998.
11 * @author : Salih Yurttas.
12 */
13
14
15import java.io.*;
16
17public class DataB implements Serializable {
18
19 int a;
20 String b;
21 int c;
22 char d;
23
24 public DataB() {
25 a = 512;
26 b = "lion";
27 c = 0;
28 d = 'E';
29 }
30
31 private void writeObject(ObjectOutputStream oOS)
32 throws IOException
33 {
34 oOS.writeInt(a);
35 oOS.writeUTF(b);
36 oOS.writeInt(c);
37 oOS.writeChar(d);
38 }
39
40 private void readObject(ObjectInputStream oIS)
41 throws IOException, ClassNotFoundException
42 {
43 a = oIS.readInt();
44 b = oIS.readUTF();
45 c = oIS.readInt();
46 d = oIS.readChar();
47 }
48
49}