📄 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 + -