Java Object Serialization
(Created page with "{{FormatInfo |formattype=electronic |subcat=Serialization |released=1997 }} '''Java Object Serialization''', often referred to by third-party sources as simply '''Java serial...") |
(Added identification information) |
||
Line 10: | Line 10: | ||
There are three different things in or attributes of a Java Object Serialization stream that are referred to by "version": | 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"; | * "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<ref>https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/guide/serialization/spec/protocol.doc.html#9303</ref><ref>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"; users must decide on it (fill this in with heuristics). | ||
+ | |||
+ | == Identification == | ||
+ | Both versions begin with the hexadecimal {{magic|ac ed}}<ref name="12tsc" /><ref name="v19303" />. | ||
== Specifications == | == Specifications == |
Revision as of 05:12, 19 April 2019
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 |
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"; users must decide on it (fill this in with heuristics).
Identification
Both versions begin with the hexadecimal ac ed
[4][3].
Specifications
References
- ↑ 1.0 1.1 1.2 Wikipedia:Java version history
- ↑ 2.0 2.1 2.2 https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/protocol.html#stream-protocol-versions
- ↑ 3.0 3.1 https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/guide/serialization/spec/protocol.doc.html#9303
- ↑ 4.0 4.1 https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/protocol.html#terminal-symbols-and-constants
- ↑ https://www.cs.princeton.edu/courses/archive/fall97/cs461/jdkdocs/
- ↑ https://docs.oracle.com/en/java/javase/12/docs/specs/serialization/version.html