jdk/src/share/classes/java/io/ObjectStreamConstants.java
author malenkov
Tue, 29 Oct 2013 17:01:06 +0400
changeset 21278 ef8a3a2a72f2
parent 5506 202f599c92aa
child 23010 6dadb192ad81
permissions -rw-r--r--
8022746: List of spelling errors in API doc Reviewed-by: alexsch, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.io;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * Constants written into the Object Serialization Stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * @author  unascribed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * @since JDK 1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
public interface ObjectStreamConstants {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
     * Magic number that is written to the stream header.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    final static short STREAM_MAGIC = (short)0xaced;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * Version number that is written to the stream header.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    final static short STREAM_VERSION = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    /* Each item in the stream is preceded by a tag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * First tag value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    final static byte TC_BASE = 0x70;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * Null object reference.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    final static byte TC_NULL =         (byte)0x70;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Reference to an object already written into the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    final static byte TC_REFERENCE =    (byte)0x71;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * new Class Descriptor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    final static byte TC_CLASSDESC =    (byte)0x72;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * new Object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    final static byte TC_OBJECT =       (byte)0x73;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * new String.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    final static byte TC_STRING =       (byte)0x74;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * new Array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    final static byte TC_ARRAY =        (byte)0x75;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * Reference to Class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    final static byte TC_CLASS =        (byte)0x76;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * Block of optional data. Byte following tag indicates number
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * of bytes in this block data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    final static byte TC_BLOCKDATA =    (byte)0x77;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * End of optional block data blocks for an object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    final static byte TC_ENDBLOCKDATA = (byte)0x78;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * Reset stream context. All handles written into stream are reset.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    final static byte TC_RESET =        (byte)0x79;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * long Block data. The long following the tag indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * number of bytes in this block data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    final static byte TC_BLOCKDATALONG= (byte)0x7A;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * Exception during write.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    final static byte TC_EXCEPTION =    (byte)0x7B;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * Long string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    final static byte TC_LONGSTRING =   (byte)0x7C;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * new Proxy Class Descriptor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    final static byte TC_PROXYCLASSDESC =       (byte)0x7D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * new Enum constant.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    final static byte TC_ENUM =         (byte)0x7E;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * Last tag value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    final static byte TC_MAX =          (byte)0x7E;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * First wire handle to be assigned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    final static int baseWireHandle = 0x7e0000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    /******************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    /* Bit masks for ObjectStreamClass flag.*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * Bit mask for ObjectStreamClass flag. Indicates a Serializable class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * defines its own writeObject method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    final static byte SC_WRITE_METHOD = 0x01;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Bit mask for ObjectStreamClass flag. Indicates Externalizable data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * written in Block Data mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * Added for PROTOCOL_VERSION_2.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @see #PROTOCOL_VERSION_2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    final static byte SC_BLOCK_DATA = 0x08;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * Bit mask for ObjectStreamClass flag. Indicates class is Serializable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    final static byte SC_SERIALIZABLE = 0x02;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * Bit mask for ObjectStreamClass flag. Indicates class is Externalizable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    final static byte SC_EXTERNALIZABLE = 0x04;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * Bit mask for ObjectStreamClass flag. Indicates class is an enum type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    final static byte SC_ENUM = 0x10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    /* *******************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    /* Security permissions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * Enable substitution of one object for another during
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * serialization/deserialization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * @see java.io.ObjectOutputStream#enableReplaceObject(boolean)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * @see java.io.ObjectInputStream#enableResolveObject(boolean)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    final static SerializablePermission SUBSTITUTION_PERMISSION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                           new SerializablePermission("enableSubstitution");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * Enable overriding of readObject and writeObject.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * @see java.io.ObjectOutputStream#writeObjectOverride(Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * @see java.io.ObjectInputStream#readObjectOverride()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    final static SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                    new SerializablePermission("enableSubclassImplementation");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    * A Stream Protocol Version. <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    * All externalizable data is written in JDK 1.1 external data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    * format after calling this method. This version is needed to write
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    * streams containing Externalizable data that can be read by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    * pre-JDK 1.1.6 JVMs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    * @see java.io.ObjectOutputStream#useProtocolVersion(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    public final static int PROTOCOL_VERSION_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    * A Stream Protocol Version. <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    * This protocol is written by JVM 1.2.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    * Externalizable data is written in block data mode and is
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 5506
diff changeset
   222
    * terminated with TC_ENDBLOCKDATA. Externalizable class descriptor
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    * flags has SC_BLOCK_DATA enabled. JVM 1.1.6 and greater can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    * read this format change.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    * Enables writing a nonSerializable class descriptor into the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    * stream. The serialVersionUID of a nonSerializable class is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    * set to 0L.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    * @see java.io.ObjectOutputStream#useProtocolVersion(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    * @see #SC_BLOCK_DATA
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    public final static int PROTOCOL_VERSION_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
}