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