当前位置:网站首页>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();
边栏推荐
- Interfaces and related concepts
- 10000小時定律不會讓你成為編程大師,但至少是個好的起點
- Selenium key knowledge explanation
- Know flex box
- CentOS switches and installs mysql5.7 and mysql8.0
- [vscode - vehicle plug-in reports an error] cannot find module 'xxx' or its corresponding type declarations Vetur(2307)
- Simple understanding of bubble sorting
- The dynamic analysis and calculation of expressions are really delicious for flee
- My 2020 summary "don't love the past, indulge in moving forward"
- The education of a value investor
猜你喜欢

JUC forkjoinpool branch merge framework - work theft

Software testing assignment - day 1

Asynchronous programming: async/await in asp Net

【类和对象】深入浅出类和对象

Yolov3 learning notes

2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)

Software testing learning - the next day

Mise en place d'un environnement de développement de fonctions personnalisées

The 10000 hour rule won't make you a master programmer, but at least it's a good starting point

Summary of the design and implementation of the weapon system similar to the paladin of vitality
随机推荐
Reading notes of "learn to ask questions"
Liang Ning: 30 lectures on brain map notes for growth thinking
JMeter JSON extractor extracts two parameters at the same time
instanceof
Pits encountered in the use of El checkbox group
Golang operation redis: write and read hash type data
The pressure of large institutions in the bear market has doubled. Will the giant whales such as gray scale, tether and micro strategy become 'giant thunder'?
How to plan well?
Laravel Web框架
Error c2017: illegal escape sequence
Unit test notes
(翻译)异步编程:Async/Await在ASP.NET中的介绍
Resttemplate configuration use
Understand software testing
[LeetCode]404. 左叶子之和
PHP install composer
[Fiddler actual operation] how to use Fiddler to capture packets on Apple Mobile Phones
Win 10 find the port and close the port
萬卷書 - 價值投資者指南 [The Education of a Value Investor]
Class and object summary