介绍java对象序列化使用基础(Describes the use of Java object serialization base).docVIP

  • 3
  • 0
  • 约9.87千字
  • 约 9页
  • 2017-10-07 发布于河南
  • 举报

介绍java对象序列化使用基础(Describes the use of Java object serialization base).doc

介绍java对象序列化使用基础(Describes the use of Java object serialization base)

介绍java对象序列化使用基础(Describes the use of Java object serialization base) 1., object serialization can implement distributed objects. Main applications, such as: RMI to serialize services on remote hosts using object serialization, like running objects on a local machine. The 2.Java object serialization not only preserves the data of an object, but also recursively saves the data of each object referenced by the object. You can write the entire object hierarchy into a byte stream that can be stored in a file or passed on a network connection. Using object serialization, you can do deep replication of objects, that is, the object itself and the referenced object itself. Serializing an object may result in the entire object sequence. From the above narrative, we know that object serialization is a necessary weapon in Java programming, so lets start with the basics and learn about its mechanics and usage. Java serialization is relatively simple and usually requires no custom code to write, save, and restore object status. A class object that implements only the interface (java.io.Serializable) can be converted into byte streams or restored from the byte stream without adding any code in the class. Only in rare cases do you need to customize code to save or restore object status. It is important to note that not every class is serializable; some classes are serializable; for example, classes involving threads have very complex relationships with a particular JVM. Serialization mechanism: Serialization is divided into two parts: serialization and de serialization. Serialization is the first part of the process, breaking data into byte streams for storage in files or for transmission over the network. Serialization means opening the byte stream and reconstructing the object. Object serialization is not only converting basic data types into byte representations, but sometimes restoring data. Restoring data requires instances of objects that recover data. The serialization proce

文档评论(0)

1亿VIP精品文档

相关文档