当前位置:网站首页>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();
边栏推荐
- Inno setup production and installation package
- centos php7.2.24升级到php7.3
- 10000小时定律不会让你成为编程大师,但至少是个好的起点
- Jmeter+influxdb+grafana of performance tools to create visual real-time monitoring of pressure measurement -- problem record
- 2022年华东师范大学计科考研复试机试题-详细题解
- Laravel frame step pit (I)
- Jenkins
- Class and object summary
- SQL implementation merges multiple rows of records into one row
- 【类和对象】深入浅出类和对象
猜你喜欢

On the practice of performance optimization and stability guarantee

Asynchronous programming: async/await in asp Net

JMeter test result output

Practice of enterprise ab/testing platform
![[classes and objects] explain classes and objects in simple terms](/img/41/250457530880dfe3728432c2ccd50b.png)
[classes and objects] explain classes and objects in simple terms

Software testing assignment - the next day

Summary of UI module design and practical application of agent mode

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

Interfaces and related concepts

Journal quotidien des questions (11)
随机推荐
MySQL mistakenly deleted the root account and failed to log in
JS date comparison
如何迁移或复制VMware虚拟机系统
MySQL transaction rollback, error points record
Reading notes of "learn to ask questions"
2022-06-23 VGMP-OSPF-域间安全策略-NAT策略(更新中)
(翻译)异步编程:Async/Await在ASP.NET中的介绍
Climb movie paradise 2021 hot
C2338 Cannot format an argument. To make type T formattable provide a formatter<T> specialization:
VMware virtual machine C disk expansion
机械观和系统观的科学思维方式各有什么特点和作用
JUC forkjoinpool branch merge framework - work theft
Pytest attempts to execute the test case without skipping, but the case shows that it is all skipped
PHP install the spool extension
[Fiddler actual operation] how to use Fiddler to capture packets on Apple Mobile Phones
[Code] if (list! = null & list. Size() > 0) optimization, set empty judgment implementation method
Software testing assignment - day 3
The essence of interview
php artisan
Asynchronous programming: async/await in asp Net