CONTENTS | PREV | NEXT | Java Object Serialization Specification |
It became necessary to make a change to the serialization stream format in JDK(tm) 1.2 that is not backwards compatible to all minor releases of JDK(tm) 1.1. To provide for cases where backwards compatibility is required, a capability has been added to indicate what PROTOCOL_VERSION to use when writing a serialization stream. The methodObjectOutputStream.useProtocolVersion
takes as a parameter the protocol version to use to write the serialization stream.Here are the Stream Protocol Versions:
JDK(tm) 1.2 defaults to writingPROTOCOL_VERSION_2
.JDK(tm) 1.1 defaults to writing
PROTOCOL_VERSION_1
.JDK(tm) 1.1.6 and greater can read both versions. Releases prior to JDK(tm) 1.1.6 can only read
PROTOCOL_VERSION_1
.