java.io

Interface ObjectStreamConstants

Known Implementing Classes:
ClassLoaderObjectInputStream, CodebaseAwareObjectInputStream, JRAbstractLRUVirtualizer.ClassLoaderAnnotationObjectInputStream, JRAbstractLRUVirtualizer.ClassLoaderAnnotationObjectOutputStream, ObjectInputStream, ObjectOutputStream

public interface ObjectStreamConstants

Constants written into the Object Serialization Stream.
Since:
JDK 1.1

Field Summary

static int
PROTOCOL_VERSION_1
A Stream Protocol Version.
static int
PROTOCOL_VERSION_2
A Stream Protocol Version.
static byte
SC_BLOCK_DATA
Bit mask for ObjectStreamClass flag.
static byte
SC_ENUM
Bit mask for ObjectStreamClass flag.
static byte
SC_EXTERNALIZABLE
Bit mask for ObjectStreamClass flag.
static byte
SC_SERIALIZABLE
Bit mask for ObjectStreamClass flag.
static byte
SC_WRITE_METHOD
Bit mask for ObjectStreamClass flag.
static short
STREAM_MAGIC
Magic number that is written to the stream header.
static short
STREAM_VERSION
Version number that is written to the stream header.
static SerializablePermission
SUBCLASS_IMPLEMENTATION_PERMISSION
Enable overriding of readObject and writeObject.
static SerializablePermission
SUBSTITUTION_PERMISSION
Enable substitution of one object for another during serialization/deserialization.
static byte
TC_ARRAY
new Array.
static byte
TC_BASE
First tag value.
static byte
TC_BLOCKDATA
Block of optional data.
static byte
TC_BLOCKDATALONG
long Block data.
static byte
TC_CLASS
Reference to Class.
static byte
TC_CLASSDESC
new Class Descriptor.
static byte
TC_ENDBLOCKDATA
End of optional block data blocks for an object.
static byte
TC_ENUM
new Enum constant.
static byte
TC_EXCEPTION
Exception during write.
static byte
TC_LONGSTRING
Long string.
static byte
TC_MAX
Last tag value.
static byte
TC_NULL
Null object reference.
static byte
TC_OBJECT
new Object.
static byte
TC_PROXYCLASSDESC
new Proxy Class Descriptor.
static byte
TC_REFERENCE
Reference to an object already written into the stream.
static byte
TC_RESET
Reset stream context.
static byte
TC_STRING
new String.
static int
baseWireHandle
First wire handle to be assigned.

Field Details

PROTOCOL_VERSION_1

public static final int PROTOCOL_VERSION_1
A Stream Protocol Version.

All externalizable data is written in JDK 1.1 external data format after calling this method. This version is needed to write streams containing Externalizable data that can be read by pre-JDK 1.1.6 JVMs.

Field Value:
1
Since:
1.2

PROTOCOL_VERSION_2

public static final int PROTOCOL_VERSION_2
A Stream Protocol Version.

This protocol is written by JVM 1.2. Externalizable data is written in block data mode and is terminated with TC_ENDBLOCKDATA. Externalizable classdescriptor flags has SC_BLOCK_DATA enabled. JVM 1.1.6 and greater can read this format change. Enables writing a nonSerializable class descriptor into the stream. The serialVersionUID of a nonSerializable class is set to 0L.

Field Value:
2
Since:
1.2
Usages and Demos :

View More Examples of ObjectStreamConstants.PROTOCOL_VERSION_2
   1: 
   2:         useProtocolVersion(ObjectStreamConstants.PROTOCOL_VERSION_2);
   3:     }
   4: 
   5:     protected void writeClassDescriptor(ObjectStreamClass classdesc)

View Full Code Here
   1:     static Class testClass = null;
   2:     static private int protocolVersion = ObjectStreamConstants.PROTOCOL_VERSION_2;
   3:     static private boolean serialize = false;
   4:     static private boolean deserialize = false;

View Full Code Here

SC_BLOCK_DATA

public static final byte SC_BLOCK_DATA
Bit mask for ObjectStreamClass flag. Indicates Externalizable data written in Block Data mode. Added for PROTOCOL_VERSION_2.
Field Value:
8
Since:
1.2

SC_ENUM

public static final byte SC_ENUM
Bit mask for ObjectStreamClass flag. Indicates class is an enum type.
Field Value:
16

SC_EXTERNALIZABLE

public static final byte SC_EXTERNALIZABLE
Bit mask for ObjectStreamClass flag. Indicates class is Externalizable.
Field Value:
4

SC_SERIALIZABLE

public static final byte SC_SERIALIZABLE
Bit mask for ObjectStreamClass flag. Indicates class is Serializable.
Field Value:
2

SC_WRITE_METHOD

public static final byte SC_WRITE_METHOD
Bit mask for ObjectStreamClass flag. Indicates a Serializable class defines its own writeObject method.
Field Value:
1

STREAM_MAGIC

public static final short STREAM_MAGIC
Magic number that is written to the stream header.
Field Value:
-21267

STREAM_VERSION

public static final short STREAM_VERSION
Version number that is written to the stream header.
Field Value:
5

SUBCLASS_IMPLEMENTATION_PERMISSION

public static final SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION
Enable overriding of readObject and writeObject.
Since:
1.2

SUBSTITUTION_PERMISSION

public static final SerializablePermission SUBSTITUTION_PERMISSION
Enable substitution of one object for another during serialization/deserialization.
Since:
1.2

TC_ARRAY

public static final byte TC_ARRAY
new Array.
Field Value:
117

TC_BASE

public static final byte TC_BASE
First tag value.
Field Value:
112

TC_BLOCKDATA

public static final byte TC_BLOCKDATA
Block of optional data. Byte following tag indicates number of bytes in this block data.
Field Value:
119

TC_BLOCKDATALONG

public static final byte TC_BLOCKDATALONG
long Block data. The long following the tag indicates the number of bytes in this block data.
Field Value:
122

TC_CLASS

public static final byte TC_CLASS
Reference to Class.
Field Value:
118

TC_CLASSDESC

public static final byte TC_CLASSDESC
new Class Descriptor.
Field Value:
114

TC_ENDBLOCKDATA

public static final byte TC_ENDBLOCKDATA
End of optional block data blocks for an object.
Field Value:
120

TC_ENUM

public static final byte TC_ENUM
new Enum constant.
Field Value:
126

TC_EXCEPTION

public static final byte TC_EXCEPTION
Exception during write.
Field Value:
123

TC_LONGSTRING

public static final byte TC_LONGSTRING
Long string.
Field Value:
124

TC_MAX

public static final byte TC_MAX
Last tag value.
Field Value:
126

TC_NULL

public static final byte TC_NULL
Null object reference.
Field Value:
112

TC_OBJECT

public static final byte TC_OBJECT
new Object.
Field Value:
115

TC_PROXYCLASSDESC

public static final byte TC_PROXYCLASSDESC
new Proxy Class Descriptor.
Field Value:
125

TC_REFERENCE

public static final byte TC_REFERENCE
Reference to an object already written into the stream.
Field Value:
113

TC_RESET

public static final byte TC_RESET
Reset stream context. All handles written into stream are reset.
Field Value:
121

TC_STRING

public static final byte TC_STRING
new String.
Field Value:
116

baseWireHandle

public static final int baseWireHandle
First wire handle to be assigned.
Field Value:
8257536