惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
H
Help Net Security
I
Intezer
G
Google Developers Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Troy Hunt's Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
J
Java Code Geeks
S
Security Affairs
T
The Blog of Author Tim Ferriss
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
D
Docker
The GitHub Blog
The GitHub Blog
F
Full Disclosure
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
S
Security @ Cisco Blogs
腾讯CDC
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
T
Threatpost
D
DataBreaches.Net
Recent Announcements
Recent Announcements
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
L
LINUX DO - 最新话题
Google Online Security Blog
Google Online Security Blog
S
Schneier on Security
S
Securelist
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Help Net Security
Help Net Security
P
Proofpoint News Feed
Project Zero
Project Zero
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 叶小钗

博客园 - CoderDream

[设计模式]单例模式 [设计模式]模板模式 Windows8下通过IPv4地址访问Tomcat RESTful最佳实践之基于 jersey 的增删改查 Maven 版 JPA 最佳实践 Android项目实战手机安全卫士(02) Android项目实战手机安全卫士(01) 推荐十一个很酷的实用网站 2006.08.21网摘 20060818网摘 20060702 长沙职位信息 20060702 网摘 20060630 网摘 Eclipse 入门与提高 第01章 基础知识 今天答辩, 第二阶段(标准阶段)已经过去了! 只剩下最后4个月了! 亿阳信通股份有限公司 J2EE软件设计工程师 上海掌上灵通咨询有限公司 Java软件开发工程师 20060519网摘
类 ObjectOutputStream的writeObject()方法的中英文对照
CoderDream · 2006-08-22 · via 博客园 - CoderDream

类 ObjectOutputStream
java.lang.Object
  java.io.OutputStream
      java.io.ObjectOutputStream
所有已实现的接口:
Closeable, DataOutput, Flushable, ObjectOutput, ObjectStreamConstants

writeObject
public final void writeObject(Object obj)
                       throws IOException


Write the specified object to the ObjectOutputStream. The class of the object, the signature of the class, and the values of the non-transient and non-static fields of the class and all of its supertypes are written. Default serialization for a class can be overridden using the writeObject and the readObject methods. Objects referenced by this object are written transitively so that a complete equivalent graph of objects can be reconstructed by an ObjectInputStream.

Exceptions are thrown for problems with the OutputStream and for classes that should not be serialized. All exceptions are fatal to the OutputStream, which is left in an indeterminate state, and it is up to the caller to ignore or recover the stream state.

Throws:
InvalidClassException Something is wrong with a class used by serialization.
NotSerializableException Some object to be serialized does not implement the java.io.Serializable interface.
IOException Any exception thrown by the underlying OutputStream.


将指定的对象写入 ObjectOutputStream。对象的类、类的签名,以及类及其所有超类型的非瞬态和非静态字段的值都将被写入。可以使用 writeObject 和 readObject 方法重写类的默认序列化。由此对象引用的对象是以可变迁的方式写入的,这样,可以通过 ObjectInputStream 重新构造这些对象的完全等价的图形。

当 OutputStream 中出现问题或者遇到不应序列化的类时,将抛出异常。所有异常对于 OutputStream 而言都是致命的,使其处于不确定状态;并由调用方来忽略或恢复流的状态。

指定者:
接口 ObjectOutput 中的 writeObject
参数:
obj - 要写入的对象
抛出:
InvalidClassException - 序列化操作使用的类出了问题。
NotSerializableException - 某个要序列化的对象不能实现 java.io.Serializable 接口。
IOException - 由基础 OutputStream 抛出的任何异常。