CONTENTS | PREV | NEXT
6.4.1 Rules of the Grammar
A Serialized stream is represented by any stream satisfying the stream rule.stream: magic version contentscontents: content contents contentcontent: object blockdataobject: newObject newClass newArray newString newClassDesc prevObject nullReference exception TC_RESETnewClass: TC_CLASS classDesc newHandleclassDesc: newClassDesc nullReference (ClassDesc)prevObject // an object required to be of type // ClassDescsuperClassDesc: classDescnewClassDesc: TC_CLASSDESC className serialVersionUID newHandle classDescInfo TC_PROXYCLASSDESC newHandle proxyClassDescInfoclassDescInfo: classDescFlags fields classAnnotation superClassDescclassName: (utf)serialVersionUID: (long)classDescFlags: (byte) // Defined in Terminal Symbols and // ConstantsproxyClassDescInfo: (int)<count> proxyInterfaceName[count] classAnnotation superClassDescproxyInterfaceName: (utf)fields: (short)<count> fieldDesc[count]fieldDesc: primitiveDesc objectDescprimitiveDesc: prim_typecode fieldNameobjectDesc: obj_typecode fieldName className1fieldName: (utf)className1: (String)object // String containing the field's type, // in field descriptor formatclassAnnotation: endBlockData contents endBlockData // contents written by annotateClassprim_typecode: `B' // byte `C' // char `D' // double `F' // float `I' // integer `J' // long `S' // short `Z' // booleanobj_typecode: `[` // array `L' // objectnewArray: TC_ARRAY classDesc newHandle (int)<size> values[size]newObject: TC_OBJECT classDesc newHandle classdata[] // data for each classclassdata: nowrclass // SC_SERIALIZABLE & classDescFlag && // !(SC_WRITE_METHOD & classDescFlags) wrclass objectAnnotation // SC_SERIALIZABLE & classDescFlag && // SC_WRITE_METHOD & classDescFlags externalContents // SC_EXTERNALIZABLE & classDescFlag && // !(SC_BLOCKDATA & classDescFlags objectAnnotation // SC_EXTERNALIZABLE & classDescFlag&& // SC_BLOCKDATA & classDescFlagsnowrclass: values // fields in order of class descriptorwrclass: nowrclassobjectAnnotation: endBlockData contents endBlockData // contents written by writeObject // or writeExternal PROTOCOL_VERSION_2.blockdata: blockdatashort blockdatalongblockdatashort: TC_BLOCKDATA (unsigned byte)<size> (byte)[size]blockdatalong: TC_BLOCKDATALONG (int)<size> (byte)[size]endBlockData : TC_ENDBLOCKDATAexternalContent: // Only parseable by readExternal ( bytes) // primitive data objectexternalContents: // externalContent written by externalContent // writeExternal in PROTOCOL_VERSION_1. externalContents externalContentnewString: TC_STRING newHandle (utf) TC_LONGSTRING newHandle (long-utf)prevObject TC_REFERENCE (int)handlenullReference TC_NULLexception: TC_EXCEPTION reset (Throwable)object resetmagic: STREAM_MAGICversion STREAM_VERSIONvalues: // The size and types are described by the // classDesc for the current objectnewHandle: // The next number in sequence is assigned // to the object being serialized or deserializedreset: // The set of known objects is discarded // so the objects of the exception do not // overlap with the previously sent objects // or with objects that may be sent after // the exception
CONTENTS | PREV | NEXT