java.io

Interface ObjectStreamConstants

Known Implementing Classes:
ObjectInputStream, ObjectOutputStream

public interface ObjectStreamConstants

This interface contains constants that are used in object serialization. This interface is used by ObjectOutputStream, ObjectInputStream, and ObjectStreamClass. The values for these constants are specified by the Java library specification.
Since:
1.1

Field Summary

static int
PROTOCOL_VERSION_1
The serialization stream protocol version 1.
static int
PROTOCOL_VERSION_2
The serialization stream protocol version 2.
static byte
SC_BLOCK_DATA
Flag used in ObjectStreamClass to designate that externalizable data is written in block data mode.
static byte
SC_ENUM
Flag used in ObjectStreamClass to designate that the class is an enum constant.
static byte
SC_EXTERNALIZABLE
Flag used in ObjectStreamClass to designate that the class is externalizable.
static byte
SC_SERIALIZABLE
Flag used in ObjectStreamClass to designate that the class is serializeable.
static byte
SC_WRITE_METHOD
Flag used in ObjectStreamClass to designate that the class defines the writeObject method.
static short
STREAM_MAGIC
The magic number that is written as part of the stream header.
static short
STREAM_VERSION
The stream version number that is written as part of the stream header.
static SerializablePermission
SUBCLASS_IMPLEMENTATION_PERMISSION
Constant for use with a SecurityManager to check if overriding of the writeObject and readObject methods is allowed.
static SerializablePermission
SUBSTITUTION_PERMISSION
Constant for use with a SecurityManager to check if substitution of objects is allowed.
static byte
TC_ARRAY
Token value to designate a new array is next in the stream.
static byte
TC_BASE
The first token value.
static byte
TC_BLOCKDATA
Token value to designate a block of primitive data is next in the stream.
static byte
TC_BLOCKDATALONG
Token value to designate a long block of primitive data is next in the stream.
static byte
TC_CLASS
Token reference to designate a reference to a class.
static byte
TC_CLASSDESC
Token value to designate a class descriptor is next in the stream.
static byte
TC_ENDBLOCKDATA
Token value to designate the end of a block of primitve data.
static byte
TC_ENUM
Token value to designate an enum constant is next in the stream.
static byte
TC_EXCEPTION
Token value to designate an exception occured during serialization.
static byte
TC_LONGSTRING
Token value to designate a long string is next in the stream.
static byte
TC_MAX
The last token value.
static byte
TC_NULL
Token value to designate a null reference in the stream.
static byte
TC_OBJECT
Token value to designate a new object is next in the stream.
static byte
TC_PROXYCLASSDESC
Token value to designate a proxy class descriptor is next in the stream.
static byte
TC_REFERENCE
Token value to designate a reference to an already serialized object.
static byte
TC_RESET
Token value to designate a reset of the stream state.
static byte
TC_STRING
Token value to designate a new string is next in the stream.
static int
baseWireHandle
The first handle that will be assigned to an object, for later references.

Field Details

PROTOCOL_VERSION_1

public static final int PROTOCOL_VERSION_1
The serialization stream protocol version 1. This version was the default serialization protocol before JDK 1.2.
Field Value:
1
Since:
1.2

PROTOCOL_VERSION_2

public static final int PROTOCOL_VERSION_2
The serialization stream protocol version 2. This version is used as the default serialization protocol since JDK 1.2.
Field Value:
2
Since:
1.2

SC_BLOCK_DATA

public static final byte SC_BLOCK_DATA
Flag used in ObjectStreamClass to designate that externalizable data is written in block data mode.
Field Value:
8
Since:
1.2

SC_ENUM

public static final byte SC_ENUM
Flag used in ObjectStreamClass to designate that the class is an enum constant.
Field Value:
16
Since:
1.5

SC_EXTERNALIZABLE

public static final byte SC_EXTERNALIZABLE
Flag used in ObjectStreamClass to designate that the class is externalizable.
Field Value:
4

SC_SERIALIZABLE

public static final byte SC_SERIALIZABLE
Flag used in ObjectStreamClass to designate that the class is serializeable.
Field Value:
2

SC_WRITE_METHOD

public static final byte SC_WRITE_METHOD
Flag used in ObjectStreamClass to designate that the class defines the writeObject method.
Field Value:
1

STREAM_MAGIC

public static final short STREAM_MAGIC
The magic number that is written as part of the stream header.
Field Value:
-21267

STREAM_VERSION

public static final short STREAM_VERSION
The stream version number that is written as part of the stream header. Note that this is different from the protocol version that specifies the data format for the stream.
Field Value:
5

SUBCLASS_IMPLEMENTATION_PERMISSION

public static final SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION
Constant for use with a SecurityManager to check if overriding of the writeObject and readObject methods is allowed.

SUBSTITUTION_PERMISSION

public static final SerializablePermission SUBSTITUTION_PERMISSION
Constant for use with a SecurityManager to check if substitution of objects is allowed.

TC_ARRAY

public static final byte TC_ARRAY
Token value to designate a new array is next in the stream.
Field Value:
117

TC_BASE

public static final byte TC_BASE
The first token value.
Field Value:
112

TC_BLOCKDATA

public static final byte TC_BLOCKDATA
Token value to designate a block of primitive data is next in the stream. The next byte in the stream holds the size of the block (in bytes).
Field Value:
119

TC_BLOCKDATALONG

public static final byte TC_BLOCKDATALONG
Token value to designate a long block of primitive data is next in the stream. The next long in the stream holds the size of the block (in bytes).
Field Value:
122

TC_CLASS

public static final byte TC_CLASS
Token reference to designate a reference to a class.
Field Value:
118

TC_CLASSDESC

public static final byte TC_CLASSDESC
Token value to designate a class descriptor is next in the stream.
Field Value:
114

TC_ENDBLOCKDATA

public static final byte TC_ENDBLOCKDATA
Token value to designate the end of a block of primitve data.
Field Value:
120

TC_ENUM

public static final byte TC_ENUM
Token value to designate an enum constant is next in the stream.
Field Value:
126
Since:
1.5

TC_EXCEPTION

public static final byte TC_EXCEPTION
Token value to designate an exception occured during serialization.
Field Value:
123

TC_LONGSTRING

public static final byte TC_LONGSTRING
Token value to designate a long string is next in the stream.
Field Value:
124

TC_MAX

public static final byte TC_MAX
The last token value.
Field Value:
126

TC_NULL

public static final byte TC_NULL
Token value to designate a null reference in the stream.
Field Value:
112

TC_OBJECT

public static final byte TC_OBJECT
Token value to designate a new object is next in the stream.
Field Value:
115

TC_PROXYCLASSDESC

public static final byte TC_PROXYCLASSDESC
Token value to designate a proxy class descriptor is next in the stream.
Field Value:
125

TC_REFERENCE

public static final byte TC_REFERENCE
Token value to designate a reference to an already serialized object.
Field Value:
113

TC_RESET

public static final byte TC_RESET
Token value to designate a reset of the stream state.
Field Value:
121

TC_STRING

public static final byte TC_STRING
Token value to designate a new string is next in the stream.
Field Value:
116

baseWireHandle

public static final int baseWireHandle
The first handle that will be assigned to an object, for later references.
Field Value:
8257536

ObjectStreamConstants.java -- Interface containing constant values used in reading and writing serialized objects Copyright (C) 1998, 1999, 2003, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.