Name

ObjectStreamConstants

Synopsis

This interface defines various constants used by the Java object-serialization mechanism. Two important constants are PROTOCOL_VERSION_1 and PROTOCOL_VERSION_2, which specify the version of the serialization protocol to use. In Java 1.2, you can pass either of these values to the useProtocolVersion( ) method of an ObjectOutputStream. By default, Java 1.2 uses Version 2 of the protocol, and Java 1.1 uses Version 1 when serializing objects. Java 1.2 can deserialize objects written using either version of the protocol, as can Java 1.1.7 and later. If you want to serialize an object so that it can be read by versions of Java prior to Java 1.1.7, use PROTOCOL_VERSION_1.

The other constants defined by this interface are low-level values used by the serialization protocol. You do not need to use them unless you are reimplementing the serialization mechanism yourself.

public interface ObjectStreamConstants {
// Public Constants
     public static final int baseWireHandle;                             =8257536
     public static final int PROTOCOL_VERSION_1;                         =1
     public static final int PROTOCOL_VERSION_2;                         =2
     public static final byte SC_BLOCK_DATA;                             =8
                  5.0  public static final byte SC_ENUM; =16
     public static final byte SC_EXTERNALIZABLE;                         =4
     public static final byte SC_SERIALIZABLE;                           =2
     public static final byte SC_WRITE_METHOD;                           =1
     public static final short STREAM_MAGIC;                             =-21267
     public static final short STREAM_VERSION;                           =5
     public static final SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.