home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 3.4 KB | 94 lines |
- /*
- * @(#)ObjectStreamConstants.java 1.16 98/03/18
- *
- * Copyright 1996-1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.io;
-
- /**
- *
- * @author unascribed
- * @version 1.16, 03/18/98
- */
- public interface ObjectStreamConstants {
- final static short STREAM_MAGIC = (short)0xaced;
- final static short STREAM_VERSION = 5;
-
- /* Each item in the stream is preceded by a tag
- */
- final static byte TC_BASE = 0x70;
- final static byte TC_NULL = (byte)0x70; // Null object reference
- final static byte TC_REFERENCE = (byte)0x71; // Reference to prev object
- final static byte TC_CLASSDESC = (byte)0x72; // Class Descriptor
- final static byte TC_OBJECT = (byte)0x73; // new object
- final static byte TC_STRING = (byte)0x74; // new String
- final static byte TC_ARRAY = (byte)0x75; // new Array
- final static byte TC_CLASS = (byte)0x76; // Reference to Class
- final static byte TC_BLOCKDATA = (byte)0x77; // Block of optional data
- final static byte TC_ENDBLOCKDATA = (byte)0x78; // End of optional data
- final static byte TC_RESET = (byte)0x79; // Reset stream context
- final static byte TC_BLOCKDATALONG= (byte)0x7A; // long block data
- final static byte TC_EXCEPTION = (byte)0x7B; // exception during write
- final static byte TC_MAX = (byte)0x7B;
-
- /* First wire handle to be assigned. */
- final static int baseWireHandle = 0x7e0000;
-
- /* Flag bits for ObjectStreamClasses in Stream. */
- final static byte SC_WRITE_METHOD = 0x01;
-
- /**
- * If SC_EXTERNALIZABLE, this bit indicates externalizable data written in
- * block data mode. Added for PROTOCOL_VERSION_2.
- *
- * @see #PROTOCOL_VERSION_2
- */
- final static byte SC_BLOCK_DATA = 0x01;
-
- final static byte SC_SERIALIZABLE = 0x02;
- final static byte SC_EXTERNALIZABLE = 0x04;
-
- /* Security permissions */
- final static SerializablePermission SUBSTITUTION_PERMISSION =
- new SerializablePermission("enableSubstitution");
-
-
- final static SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
- new SerializablePermission("enableSubclassImplementation");
- /**
- * A Stream Protocol Version. <p>
- *
- * 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.
- *
- * @see java.io.ObjectOutputStream#useProtocolVersion(int)
- */
- public final static int PROTOCOL_VERSION_1 = 1;
-
-
- /**
- * A Stream Protocol Version. <p>
- *
- * This protocol is written by JVM 1.2 and can be read by
- * JVM 1.1.6 and later versions. Externalizable data is
- * written in block data mode and is terminated with
- * TC_ENDBLOCKDATA. Externalizable classdescriptor flags
- * has SC_BLOCK_DATA enabled.
- *
- * @see java.io.ObjectOutputStream#useProtocolVersion(int)
- * @see #SC_BLOCK_DATA
- */
- public final static int PROTOCOL_VERSION_2 = 2;
- }
-