-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoImplAbstractExample.java
More file actions
37 lines (23 loc) · 952 Bytes
/
Copy pathpoImplAbstractExample.java
File metadata and controls
37 lines (23 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package Serializable;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
/*AbstractExample的实现类,符合读写约束规范的实现类*/
public class poImplAbstractExample extends AbstractExample implements Serializable {
private static final long serialVersionUID = 576567009347197819L;
private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException {
inputStream.defaultReadObject();
int x=inputStream.readInt();
String y= String.valueOf(inputStream.readChar());
initVars(x,y);
}
private void writeObject(ObjectOutputStream outputStream) throws IOException {
outputStream.defaultWriteObject();
outputStream.writeObject(getX());
outputStream.writeObject(getY());
}
public poImplAbstractExample(int x, String y) {
super(x, y);
}
}