
io
猪尾九
努力!
展开
-
ByteArrayOutputStream/ByteArrayInputStream
一.ByteArrayOutputStream: 可以捕获内存缓冲区的数据,转换成字节数组 /字符串ByteArrayInputStream: 可以将字节数组转化为输入流public static void main(String[] args) { int a = 222; int b = 1; int c = 2; ByteArra...转载 2018-05-19 21:41:22 · 644 阅读 · 0 评论 -
ObjectStream
例:将Employee对象及数组对象存储在文件中,再读出. 其中age属性不需要序列化/* * 需要序列化的对象必须实现Serializable接口(空接口) * 若其中存在不想序列化的属性,加transient关键字 */public class Employee implements Serializable{ private String name; private tra...原创 2018-07-31 20:52:46 · 720 阅读 · 0 评论