当前位置:网站首页>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();
边栏推荐
- Asynchronous programming: async/await in asp Net
- Summary of remote connection of MySQL
- Jenkins
- golang操作redis:写入、读取kv数据
- Strategy mode
- 熊市里的大机构压力倍增,灰度、Tether、微策略等巨鲸会不会成为'巨雷'?
- Basic teaching of crawler code
- 10000小时定律不会让你成为编程大师,但至少是个好的起点
- The education of a value investor
- C2338 Cannot format an argument. To make type T formattable provide a formatter<T> specialization:
猜你喜欢

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

卡特兰数(Catalan)的应用场景

2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)

Win 10 find the port and close the port

Sorting out the core ideas of the pyramid principle

Summary of the design and implementation of the weapon system similar to the paladin of vitality

10000小時定律不會讓你成為編程大師,但至少是個好的起點

Daily question brushing record (11)

Interfaces and related concepts

Journal quotidien des questions (11)
随机推荐
Error c2017: illegal escape sequence
2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)
[Fiddler actual operation] how to use Fiddler to capture packets on Apple Mobile Phones
[classes and objects] explain classes and objects in simple terms
Operation principle of lua on C: Foundation
Laravel框架 踩坑(一)
【code】if (list != null && list.size() > 0)优化,集合判空实现方式
Notes on the core knowledge of Domain Driven Design DDD
Search engine Bing Bing advanced search skills
(翻译)异步编程:Async/Await在ASP.NET中的介绍
Pytest -- write and manage test cases
Unittest attempt
CentOS php7.3 installing redis extensions
2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)
The 10000 hour rule won't make you a master programmer, but at least it's a good starting point
Know flex box
dataworks自定义函数开发环境搭建
Interfaces and related concepts
【无标题】
centos php7.2.24升级到php7.3