Java Object Serialization

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Added identification information)
m (Removed incomplete remark and note to myself)
 
Line 12: Line 12:
 
* an integer field in the header called "STREAM_VERSION" or just "version", which has been 5<ref name="v19303">https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/guide/serialization/spec/protocol.doc.html#9303</ref><ref name="12tsc">https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/protocol.html#terminal-symbols-and-constants</ref> since at least JDK 1.1.4<ref>https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/</ref>, released between 1997 and 1998<ref name="wvh" />, meaning that it has had the value of 5 for almost all of the format's existence;
 
* an integer field in the header called "STREAM_VERSION" or just "version", which has been 5<ref name="v19303">https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/guide/serialization/spec/protocol.doc.html#9303</ref><ref name="12tsc">https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/protocol.html#terminal-symbols-and-constants</ref> since at least JDK 1.1.4<ref>https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/</ref>, released between 1997 and 1998<ref name="wvh" />, meaning that it has had the value of 5 for almost all of the format's existence;
 
* and the "version" not of the Object Serialization format, but of whatever format is built on top of it<ref>https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/version.html</ref>.
 
* and the "version" not of the Object Serialization format, but of whatever format is built on top of it<ref>https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/version.html</ref>.
The "protocol version" can be either 1 or 2. The second version was made standard in the Java platform in version 1.2<ref name="12vs" /> in December 1998<ref name="wvh" />. Java versions at and above 1.1.7 can read both versions, but will default to writing and reading 2<ref name="12vs" />. There is nothing in the stream to indicate the "protocol version"; users must decide on it (fill this in with heuristics).
+
The "protocol version" can be either 1 or 2. The second version was made standard in the Java platform in version 1.2<ref name="12vs" /> in December 1998<ref name="wvh" />. Java versions at and above 1.1.7 can read both versions, but will default to writing and reading 2<ref name="12vs" />. There is nothing in the stream to indicate the "protocol version".
  
 
== Identification ==
 
== Identification ==

Latest revision as of 05:28, 19 April 2019

File Format
Name Java Object Serialization
Ontology
Released 1997

Java Object Serialization, often referred to by third-party sources as simply Java serialization, is the native serialization format for the Java programming language, analogous to the Pickle format for Python. It appears to have been introduced in 1997[1], with version 1.1.[2]

Contents

[edit] Versions

There are three different things in or attributes of a Java Object Serialization stream that are referred to by "version":

  • "protocol version", which corresponds to the usual meaning of "version";
  • an integer field in the header called "STREAM_VERSION" or just "version", which has been 5[3][4] since at least JDK 1.1.4[5], released between 1997 and 1998[1], meaning that it has had the value of 5 for almost all of the format's existence;
  • and the "version" not of the Object Serialization format, but of whatever format is built on top of it[6].

The "protocol version" can be either 1 or 2. The second version was made standard in the Java platform in version 1.2[2] in December 1998[1]. Java versions at and above 1.1.7 can read both versions, but will default to writing and reading 2[2]. There is nothing in the stream to indicate the "protocol version".

[edit] Identification

Both versions begin with the hexadecimal ac ed[4][3].

[edit] Specifications

[edit] References

  1. 1.0 1.1 1.2 Wikipedia:Java version history
  2. 2.0 2.1 2.2 https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/protocol.html#stream-protocol-versions
  3. 3.0 3.1 https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/guide/serialization/spec/protocol.doc.html#9303
  4. 4.0 4.1 https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/protocol.html#terminal-symbols-and-constants
  5. https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/
  6. https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/version.html
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox