?? custominfo.java
字號:
package com.j2medev.chapter3;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class CustomInfo{
public int age = -1;
public String description = "";
public CustomInfo(){}
public CustomInfo(int _age,String _desc){
age = _age;
description = _desc;
}
public void serialize(DataOutputStream dos) throws IOException{
dos.writeInt(age);
dos.writeUTF(description);
}
public static CustomInfo deserialize(DataInputStream dis) throws IOException{
CustomInfo ci = new CustomInfo();
ci.age = dis.readInt();
ci.description = dis.readUTF();
return ci;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -