Skip to main content

java_serialization/
constants.rs

1/// Magic number written to the stream header.
2pub const STREAM_MAGIC: u16 = 0xACED;
3
4/// Version number written to the stream header.
5pub const STREAM_VERSION: u16 = 5;
6
7// Type codes (terminal symbols)
8
9/// Null object reference.
10pub const TC_NULL: u8 = 0x70;
11
12/// Reference to an object already written into the stream.
13pub const TC_REFERENCE: u8 = 0x71;
14
15/// New Class Descriptor.
16pub const TC_CLASSDESC: u8 = 0x72;
17
18/// New Object.
19pub const TC_OBJECT: u8 = 0x73;
20
21/// New String.
22pub const TC_STRING: u8 = 0x74;
23
24/// New Array.
25pub const TC_ARRAY: u8 = 0x75;
26
27/// Reference to Class.
28pub const TC_CLASS: u8 = 0x76;
29
30/// Block of optional data (short).
31pub const TC_BLOCKDATA: u8 = 0x77;
32
33/// End of optional block data blocks.
34pub const TC_ENDBLOCKDATA: u8 = 0x78;
35
36/// Reset stream context.
37pub const TC_RESET: u8 = 0x79;
38
39/// Long block data.
40pub const TC_BLOCKDATALONG: u8 = 0x7A;
41
42/// Exception during write.
43pub const TC_EXCEPTION: u8 = 0x7B;
44
45/// Long string.
46pub const TC_LONGSTRING: u8 = 0x7C;
47
48/// New Proxy Class Descriptor.
49pub const TC_PROXYCLASSDESC: u8 = 0x7D;
50
51/// New Enum constant.
52pub const TC_ENUM: u8 = 0x7E;
53
54// Class descriptor flags
55
56/// Serializable class defines writeObject method.
57pub const SC_WRITE_METHOD: u8 = 0x01;
58
59/// Class is Serializable.
60pub const SC_SERIALIZABLE: u8 = 0x02;
61
62/// Class is Externalizable.
63pub const SC_EXTERNALIZABLE: u8 = 0x04;
64
65/// Externalizable data written in Block Data mode.
66pub const SC_BLOCK_DATA: u8 = 0x08;
67
68/// Class is an enum type.
69pub const SC_ENUM: u8 = 0x10;
70
71/// First wire handle to be assigned.
72pub const BASE_WIRE_HANDLE: u32 = 0x7E0000;