001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package java.io;
019:
020: /**
021: * Helper interface with constants used by the serialization implementation.
022: */
023: public abstract interface ObjectStreamConstants {
024:
025: /**
026: * Used for the stream header
027: */
028: public static final short STREAM_MAGIC = (short) 0xaced;
029:
030: /**
031: * Used for the stream header
032: */
033: public static final short STREAM_VERSION = 5;
034:
035: // These are tags to indicate the stream contents
036: public static final byte TC_BASE = 0x70;
037:
038: public static final byte TC_NULL = (byte) 0x70;
039:
040: public static final byte TC_REFERENCE = (byte) 0x71;
041:
042: public static final byte TC_CLASSDESC = (byte) 0x72;
043:
044: public static final byte TC_OBJECT = (byte) 0x73;
045:
046: public static final byte TC_STRING = (byte) 0x74;
047:
048: public static final byte TC_ARRAY = (byte) 0x75;
049:
050: public static final byte TC_CLASS = (byte) 0x76;
051:
052: public static final byte TC_BLOCKDATA = (byte) 0x77;
053:
054: public static final byte TC_ENDBLOCKDATA = (byte) 0x78;
055:
056: public static final byte TC_RESET = (byte) 0x79;
057:
058: public static final byte TC_BLOCKDATALONG = (byte) 0x7A;
059:
060: public static final byte TC_EXCEPTION = (byte) 0x7B;
061:
062: public static final byte TC_LONGSTRING = (byte) 0x7C;
063:
064: public static final byte TC_PROXYCLASSDESC = (byte) 0x7D;
065:
066: public static final byte TC_MAX = 0x7E;
067:
068: /**
069: * The first object dumped gets assigned this handle/ID
070: */
071: public static final int baseWireHandle = 0x007e0000;
072:
073: public static final int PROTOCOL_VERSION_1 = 1;
074:
075: public static final int PROTOCOL_VERSION_2 = 2;
076:
077: public static final SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION = new SerializablePermission(
078: "enableSubclassImplementation"); //$NON-NLS-1$
079:
080: public static final SerializablePermission SUBSTITUTION_PERMISSION = new SerializablePermission(
081: "enableSubstitution"); //$NON-NLS-1$
082:
083: // Flags that indicate if the object was serializable, externalizable
084: // and had a writeObject method when dumped.
085: public static final byte SC_WRITE_METHOD = 0x01; // If SC_SERIALIZABLE
086:
087: public static final byte SC_SERIALIZABLE = 0x02;
088:
089: public static final byte SC_EXTERNALIZABLE = 0x04;
090:
091: public static final byte SC_BLOCK_DATA = 0x08; // If SC_EXTERNALIZABLE
092:
093: /**
094: * constant for new enum
095: */
096: public static final byte TC_ENUM = 0x7E;
097:
098: /**
099: * the bitmask denoting that the object is a enum
100: */
101: public static final byte SC_ENUM = 0x10;
102: }
|