jaroslav@601: /* jaroslav@601: * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. jaroslav@601: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jaroslav@601: * jaroslav@601: * This code is free software; you can redistribute it and/or modify it jaroslav@601: * under the terms of the GNU General Public License version 2 only, as jaroslav@601: * published by the Free Software Foundation. Oracle designates this jaroslav@601: * particular file as subject to the "Classpath" exception as provided jaroslav@601: * by Oracle in the LICENSE file that accompanied this code. jaroslav@601: * jaroslav@601: * This code is distributed in the hope that it will be useful, but WITHOUT jaroslav@601: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jaroslav@601: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jaroslav@601: * version 2 for more details (a copy is included in the LICENSE file that jaroslav@601: * accompanied this code). jaroslav@601: * jaroslav@601: * You should have received a copy of the GNU General Public License version jaroslav@601: * 2 along with this work; if not, write to the Free Software Foundation, jaroslav@601: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jaroslav@601: * jaroslav@601: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jaroslav@601: * or visit www.oracle.com if you need additional information or have any jaroslav@601: * questions. jaroslav@601: */ jaroslav@601: jaroslav@601: package java.io; jaroslav@601: jaroslav@601: /** jaroslav@601: * Constants written into the Object Serialization Stream. jaroslav@601: * jaroslav@601: * @author unascribed jaroslav@601: * @since JDK 1.1 jaroslav@601: */ jaroslav@601: public interface ObjectStreamConstants { jaroslav@601: jaroslav@601: /** jaroslav@601: * Magic number that is written to the stream header. jaroslav@601: */ jaroslav@601: final static short STREAM_MAGIC = (short)0xaced; jaroslav@601: jaroslav@601: /** jaroslav@601: * Version number that is written to the stream header. jaroslav@601: */ jaroslav@601: final static short STREAM_VERSION = 5; jaroslav@601: jaroslav@601: /* Each item in the stream is preceded by a tag jaroslav@601: */ jaroslav@601: jaroslav@601: /** jaroslav@601: * First tag value. jaroslav@601: */ jaroslav@601: final static byte TC_BASE = 0x70; jaroslav@601: jaroslav@601: /** jaroslav@601: * Null object reference. jaroslav@601: */ jaroslav@601: final static byte TC_NULL = (byte)0x70; jaroslav@601: jaroslav@601: /** jaroslav@601: * Reference to an object already written into the stream. jaroslav@601: */ jaroslav@601: final static byte TC_REFERENCE = (byte)0x71; jaroslav@601: jaroslav@601: /** jaroslav@601: * new Class Descriptor. jaroslav@601: */ jaroslav@601: final static byte TC_CLASSDESC = (byte)0x72; jaroslav@601: jaroslav@601: /** jaroslav@601: * new Object. jaroslav@601: */ jaroslav@601: final static byte TC_OBJECT = (byte)0x73; jaroslav@601: jaroslav@601: /** jaroslav@601: * new String. jaroslav@601: */ jaroslav@601: final static byte TC_STRING = (byte)0x74; jaroslav@601: jaroslav@601: /** jaroslav@601: * new Array. jaroslav@601: */ jaroslav@601: final static byte TC_ARRAY = (byte)0x75; jaroslav@601: jaroslav@601: /** jaroslav@601: * Reference to Class. jaroslav@601: */ jaroslav@601: final static byte TC_CLASS = (byte)0x76; jaroslav@601: jaroslav@601: /** jaroslav@601: * Block of optional data. Byte following tag indicates number jaroslav@601: * of bytes in this block data. jaroslav@601: */ jaroslav@601: final static byte TC_BLOCKDATA = (byte)0x77; jaroslav@601: jaroslav@601: /** jaroslav@601: * End of optional block data blocks for an object. jaroslav@601: */ jaroslav@601: final static byte TC_ENDBLOCKDATA = (byte)0x78; jaroslav@601: jaroslav@601: /** jaroslav@601: * Reset stream context. All handles written into stream are reset. jaroslav@601: */ jaroslav@601: final static byte TC_RESET = (byte)0x79; jaroslav@601: jaroslav@601: /** jaroslav@601: * long Block data. The long following the tag indicates the jaroslav@601: * number of bytes in this block data. jaroslav@601: */ jaroslav@601: final static byte TC_BLOCKDATALONG= (byte)0x7A; jaroslav@601: jaroslav@601: /** jaroslav@601: * Exception during write. jaroslav@601: */ jaroslav@601: final static byte TC_EXCEPTION = (byte)0x7B; jaroslav@601: jaroslav@601: /** jaroslav@601: * Long string. jaroslav@601: */ jaroslav@601: final static byte TC_LONGSTRING = (byte)0x7C; jaroslav@601: jaroslav@601: /** jaroslav@601: * new Proxy Class Descriptor. jaroslav@601: */ jaroslav@601: final static byte TC_PROXYCLASSDESC = (byte)0x7D; jaroslav@601: jaroslav@601: /** jaroslav@601: * new Enum constant. jaroslav@601: * @since 1.5 jaroslav@601: */ jaroslav@601: final static byte TC_ENUM = (byte)0x7E; jaroslav@601: jaroslav@601: /** jaroslav@601: * Last tag value. jaroslav@601: */ jaroslav@601: final static byte TC_MAX = (byte)0x7E; jaroslav@601: jaroslav@601: /** jaroslav@601: * First wire handle to be assigned. jaroslav@601: */ jaroslav@601: final static int baseWireHandle = 0x7e0000; jaroslav@601: jaroslav@601: jaroslav@601: /******************************************************/ jaroslav@601: /* Bit masks for ObjectStreamClass flag.*/ jaroslav@601: jaroslav@601: /** jaroslav@601: * Bit mask for ObjectStreamClass flag. Indicates a Serializable class jaroslav@601: * defines its own writeObject method. jaroslav@601: */ jaroslav@601: final static byte SC_WRITE_METHOD = 0x01; jaroslav@601: jaroslav@601: /** jaroslav@601: * Bit mask for ObjectStreamClass flag. Indicates Externalizable data jaroslav@601: * written in Block Data mode. jaroslav@601: * Added for PROTOCOL_VERSION_2. jaroslav@601: * jaroslav@601: * @see #PROTOCOL_VERSION_2 jaroslav@601: * @since 1.2 jaroslav@601: */ jaroslav@601: final static byte SC_BLOCK_DATA = 0x08; jaroslav@601: jaroslav@601: /** jaroslav@601: * Bit mask for ObjectStreamClass flag. Indicates class is Serializable. jaroslav@601: */ jaroslav@601: final static byte SC_SERIALIZABLE = 0x02; jaroslav@601: jaroslav@601: /** jaroslav@601: * Bit mask for ObjectStreamClass flag. Indicates class is Externalizable. jaroslav@601: */ jaroslav@601: final static byte SC_EXTERNALIZABLE = 0x04; jaroslav@601: jaroslav@601: /** jaroslav@601: * Bit mask for ObjectStreamClass flag. Indicates class is an enum type. jaroslav@601: * @since 1.5 jaroslav@601: */ jaroslav@601: final static byte SC_ENUM = 0x10; jaroslav@601: jaroslav@601: jaroslav@601: /* *******************************************************************/ jaroslav@601: /* Security permissions */ jaroslav@601: jaroslav@601: /** jaroslav@601: * A Stream Protocol Version.

jaroslav@601: * jaroslav@601: * All externalizable data is written in JDK 1.1 external data jaroslav@601: * format after calling this method. This version is needed to write jaroslav@601: * streams containing Externalizable data that can be read by jaroslav@601: * pre-JDK 1.1.6 JVMs. jaroslav@601: * jaroslav@601: * @see java.io.ObjectOutputStream#useProtocolVersion(int) jaroslav@601: * @since 1.2 jaroslav@601: */ jaroslav@601: public final static int PROTOCOL_VERSION_1 = 1; jaroslav@601: jaroslav@601: jaroslav@601: /** jaroslav@601: * A Stream Protocol Version.

jaroslav@601: * jaroslav@601: * This protocol is written by JVM 1.2. jaroslav@601: * jaroslav@601: * Externalizable data is written in block data mode and is jaroslav@601: * terminated with TC_ENDBLOCKDATA. Externalizable classdescriptor jaroslav@601: * flags has SC_BLOCK_DATA enabled. JVM 1.1.6 and greater can jaroslav@601: * read this format change. jaroslav@601: * jaroslav@601: * Enables writing a nonSerializable class descriptor into the jaroslav@601: * stream. The serialVersionUID of a nonSerializable class is jaroslav@601: * set to 0L. jaroslav@601: * jaroslav@601: * @see java.io.ObjectOutputStream#useProtocolVersion(int) jaroslav@601: * @see #SC_BLOCK_DATA jaroslav@601: * @since 1.2 jaroslav@601: */ jaroslav@601: public final static int PROTOCOL_VERSION_2 = 2; jaroslav@601: }