home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / io / ObjectStreamConstants.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  3.4 KB  |  94 lines

  1. /*
  2.  * @(#)ObjectStreamConstants.java    1.16 98/03/18
  3.  *
  4.  * Copyright 1996-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. /**
  18.  *
  19.  * @author  unascribed
  20.  * @version 1.16, 03/18/98
  21.  */
  22. public interface ObjectStreamConstants {
  23.     final static short STREAM_MAGIC = (short)0xaced;
  24.     final static short STREAM_VERSION = 5;
  25.  
  26.     /* Each item in the stream is preceded by a tag
  27.      */
  28.     final static byte TC_BASE = 0x70;
  29.     final static byte TC_NULL =     (byte)0x70; // Null object reference
  30.     final static byte TC_REFERENCE =    (byte)0x71; // Reference to prev object
  31.     final static byte TC_CLASSDESC =     (byte)0x72; // Class Descriptor
  32.     final static byte TC_OBJECT =     (byte)0x73; // new object
  33.     final static byte TC_STRING =     (byte)0x74; // new String
  34.     final static byte TC_ARRAY =     (byte)0x75; // new Array
  35.     final static byte TC_CLASS =     (byte)0x76; // Reference to Class 
  36.     final static byte TC_BLOCKDATA =     (byte)0x77; // Block of optional data
  37.     final static byte TC_ENDBLOCKDATA =    (byte)0x78; // End of optional data
  38.     final static byte TC_RESET =     (byte)0x79; // Reset stream context
  39.     final static byte TC_BLOCKDATALONG= (byte)0x7A; // long block data
  40.     final static byte TC_EXCEPTION =     (byte)0x7B; // exception during write
  41.     final static byte TC_MAX =         (byte)0x7B;
  42.  
  43.     /* First wire handle to be assigned. */
  44.     final static int baseWireHandle = 0x7e0000;
  45.  
  46.     /* Flag bits for ObjectStreamClasses in Stream. */
  47.     final static byte SC_WRITE_METHOD = 0x01;
  48.  
  49.     /**
  50.      * If SC_EXTERNALIZABLE, this bit indicates externalizable data written in
  51.      * block data mode. Added for PROTOCOL_VERSION_2.
  52.      *
  53.      * @see #PROTOCOL_VERSION_2
  54.      */
  55.     final static byte SC_BLOCK_DATA = 0x01;  
  56.  
  57.     final static byte SC_SERIALIZABLE = 0x02;
  58.     final static byte SC_EXTERNALIZABLE = 0x04;
  59.  
  60.     /* Security permissions */
  61.     final static SerializablePermission SUBSTITUTION_PERMISSION =
  62.                            new SerializablePermission("enableSubstitution");
  63.  
  64.  
  65.     final static SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
  66.                     new SerializablePermission("enableSubclassImplementation");
  67.    /**
  68.     * A Stream Protocol Version. <p>
  69.     * 
  70.     * All externalizable data is written in JDK 1.1 external data 
  71.     * format after calling this method. This version is needed to write 
  72.     * streams containing Externalizable data that can be read by 
  73.     * pre-JDK 1.1.6 JVMs.
  74.     *
  75.     * @see java.io.ObjectOutputStream#useProtocolVersion(int)
  76.     */
  77.     public final static int PROTOCOL_VERSION_1 = 1;
  78.  
  79.     
  80.    /**
  81.     * A Stream Protocol Version. <p>
  82.     * 
  83.     * This protocol is written by JVM 1.2 and can be read by
  84.     * JVM 1.1.6 and later versions. Externalizable data is
  85.     * written in block data mode and is terminated with
  86.     * TC_ENDBLOCKDATA. Externalizable classdescriptor flags
  87.     * has SC_BLOCK_DATA enabled.
  88.     *
  89.     * @see java.io.ObjectOutputStream#useProtocolVersion(int)
  90.     * @see #SC_BLOCK_DATA
  91.     */
  92.     public final static int PROTOCOL_VERSION_2 = 2;
  93. }
  94.