当前位置:网站首页>Advanced API (serialization & deserialization)
Advanced API (serialization & deserialization)
2022-07-03 07:01:00 【Bugxiu_ fu】
serialize ObjectOutputStream
Save the objects generated in memory to a text file
All classes to be serialized must implement Serializable Interface
Student implements Serializable{
private static final long serialVersionUID = 1L;
}
Deserialization ObjectInputStream
The contents of the local file ( object )-- Read to memory
The basic format :
serialize
Prepare an object
Student stu = new Student(1, " Huqing stick ");
File file = new File("D:\\stu.bak");
FileOutputStream fos = new FileOutputStream(file);
Write through serialized stream ObjectOutputStream
ObjectOutputStream oos = new ObjectOutputStream(fos);
Write an object through the serialization stream
oos.writeObject(stu);
close
oos.close();
fos.close();
边栏推荐
- Architecture notes
- 2022 East China Normal University postgraduate entrance examination machine test questions - detailed solution
- Application scenarios of Catalan number
- Basic teaching of crawler code
- instanceof
- Unittest attempt
- Troubleshooting of high CPU load but low CPU usage
- RestHighLevelClient获取某个索引的mapping
- Software testing assignment - the next day
- centos php7.2.24升级到php7.3
猜你喜欢
POI excel percentage
Notes on the core knowledge of Domain Driven Design DDD
golang操作redis:写入、读取hash类型数据
10000小時定律不會讓你成為編程大師,但至少是個好的起點
2022-06-23 vgmp OSPF inter domain security policy NAT policy (under update)
利用C#实现Pdf转图片
vmware虚拟机C盘扩容
The 10000 hour rule won't make you a master programmer, but at least it's a good starting point
Software testing assignment - the next day
[Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet
随机推荐
萬卷書 - 價值投資者指南 [The Education of a Value Investor]
每日刷题记录 (十一)
[LeetCode]404. 左叶子之和
Flask Foundation
Crontab scheduled task
Pits encountered in the use of El checkbox group
Understand software testing
Software testing assignment - day 1
Troubleshooting of high CPU load but low CPU usage
Shim and Polyfill in [concept collection]
2022年华东师范大学计科考研复试机试题-详细题解
UTC时间、GMT时间、CST时间
dataworks自定义函数开发环境搭建
Create your own deep learning environment with CONDA
Win 10 find the port and close the port
Summary of the design and implementation of the weapon system similar to the paladin of vitality
[LeetCode]404. Sum of left leaves
Arctic code vault contributor
Interfaces and related concepts
爬虫代码基础教学