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