| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547 |
- <html>
- <head>
- <title>Binary Serialization Format</title>
- <style> body { FONT-SIZE: x-small; FONT-FAMILY: arial }
- table { FONT-SIZE: x-small; FONT-FAMILY: arial }
- </style>
- </head>
- <body>
- <H1>Binary Serialization Format</H1>
- <P>by Lluis Sanchez Gual (<A href="mailto:[email protected]">[email protected]</A>)</P>
- <UL>
- <LI>
- <A href="#intro">Introduction</A>
- <LI>
- <A href="#format">Format description</A>
- <UL>
- <LI>
- <A href="#example">An example</A></LI></UL>
- <LI>
- <A href="#elements">Binary elements</A>
- <UL>
- <LI>
- <A href="#elem1">1 - RefTypeObject</A>
- <LI>
- <A href="#elem4">4 - RuntimeObject</A>
- <LI>
- <A href="#elem5">5 - ExternalObject</A>
- <LI>
- <A href="#elem6">6 - String</A>
- <LI>
- <A href="#elem7">7 - GenericArray</A>
- <LI>
- <A href="#elem8">8 - BoxedPrimitiveTypeValue</A>
- <LI>
- <A href="#elem9">9 - ObjectReference</A>
- <LI>
- <A href="#elem10">10 - NullValue</A>
- <LI>
- <A href="#elem11">11 - End</A>
- <LI>
- <A href="#elem12">12 - Assembly</A>
- <LI>
- <A href="#elem13">13 - ArrayFiller8b</A>
- <LI>
- <A href="#elem14">14 - ArrayFiller32b</A>
- <LI>
- <A href="#elem15">15 - ArrayOfPrimitiveType</A>
- <LI>
- <A href="#elem16">16 - ArrayOfObject</A>
- <LI>
- <A href="#elem17">17 - ArrayOfString</A>
- <LI>
- <A href="#elem21">21 - MethodCall</A>
- <LI>
- <A href="#elem22">22 - MethodResponse</A></LI></UL>
- <LI>
- <A href="#other">Other Elements</A>
- </LI>
- <UL>
- <LI>
- <A href="#string">string</A>
- <LI>
- <A href="#primitive-value">primitive-value</A>
- <LI>
- <A href="#value">value</A>
- <LI>
- <A href="#type-tag">type-tag</A>
- <LI>
- <A href="#type-spec">type-spec</A>
- <LI>
- <A href="#method-call-flags">method-call-flags</A>
- <LI>
- <A href="#method-response-flags">method-response-flags</A>
- <LI>
- <A href="#return-type-tag">return-type-tag</A>
- <LI>
- <A href="#primitive-type-code">primitive-type-code</A></LI></UL>
- </UL>
- <a name="intro"></a>
- <H2>Introduction</H2>
- <P>This document describes the format used by the class BinaryFormatter to
- serialize object graphs. The document is based on the analysis of the output of
- the BinaryFormatter of the Microsoft .NET runtime, so it is probably not
- complete, since I cannot be sure that I have tested all cases. In fact, there
- are some gaps in some tables of codes, so if you find a meaning for the missing
- codes, please contact me and I'll update the document.</P>
- <a name="format"></a>
- <H2>Format description</H2>
- <P>An object serialization is a sequence of binary elements. A binary element
- coluld be for example a description of an object, an array, an assembly, etc.
- Each binary element has a specific format, which is described in the following
- sections.</P>
- <P>This table shows the available binary elements:</P>
- <P>
- <TABLE id="Table1" style="WIDTH: 560px; HEIGHT: 94px" cellSpacing="1" cellPadding="1" width="560" border="1">
- <TR>
- <TD width="40"><STRONG>Code</STRONG></TD>
- <TD><STRONG>Label</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="40">0</TD>
- <TD>Header</TD>
- <TD>Allways written at the beggining of a serialization</TD>
- </TR>
- <TR>
- <TD width="40">1</TD>
- <TD><A href="#elem1">RefTypeObject</A></TD>
- <TD>Object with no type metadata</TD>
- </TR>
- <TR>
- <TD width="40">4</TD>
- <TD><A href="#elem4">RuntimeObject</A></TD>
- <TD>Corlib object</TD>
- </TR>
- <TR>
- <TD width="40">5</TD>
- <TD><A href="#elem5">ExternalObject</A></TD>
- <TD>Object</TD>
- </TR>
- <TR>
- <TD width="40">6</TD>
- <TD><A href="#elem6">String</A></TD>
- <TD>String</TD>
- </TR>
- <TR>
- <TD width="40">7</TD>
- <TD><A href="#elem7">GenericArray</A></TD>
- <TD>Array</TD>
- </TR>
- <TR>
- <TD width="40">8</TD>
- <TD><A href="#elem8">BoxedPrimitiveTypeValue</A></TD>
- <TD>Primitive type value</TD>
- </TR>
- <TR>
- <TD width="40">9</TD>
- <TD><A href="#elem9">ObjectReference</A></TD>
- <TD>Object reference</TD>
- </TR>
- <TR>
- <TD width="40">10</TD>
- <TD><A href="#elem10">NullValue</A></TD>
- <TD>Null value</TD>
- </TR>
- <TR>
- <TD width="40">11</TD>
- <TD><A href="#elem11">End</A></TD>
- <TD>End of stream</TD>
- </TR>
- <TR>
- <TD width="40">12</TD>
- <TD><A href="#elem12">Assembly</A></TD>
- <TD>Assembly declaration</TD>
- </TR>
- <TR>
- <TD width="40">13</TD>
- <TD><A href="#elem13">ArrayFiller8b</A></TD>
- <TD>Null filler (8 bit length)</TD>
- </TR>
- <TR>
- <TD width="40">14</TD>
- <TD><A href="#elem14">ArrayFiller32b</A></TD>
- <TD>Null filler (16 bit length)</TD>
- </TR>
- <TR>
- <TD width="40">15</TD>
- <TD><A href="#elem15">ArrayOfPrimitiveType</A></TD>
- <TD>Array of primitive type</TD>
- </TR>
- <TR>
- <TD width="40">16</TD>
- <TD><A href="#elem16">ArrayOfObject</A></TD>
- <TD>Array of Object</TD>
- </TR>
- <TR>
- <TD width="40">17</TD>
- <TD><A href="#elem17">ArrayOfString</A></TD>
- <TD>Array of string</TD>
- </TR>
- <TR>
- <TD width="40">21</TD>
- <TD><A href="#elem21">MethodCall</A></TD>
- <TD>Method call</TD>
- </TR>
- <TR>
- <TD width="40">22</TD>
- <TD><A href="#elem22">MethodResponse</A></TD>
- <TD>Method response</TD>
- </TR>
- </TABLE>
- </P>
- <P>All elements begin with a byte that identifies the type of element. It is shown
- in the "Code" column. In the implementation of the formatter I use an enum to
- represent those codes. The "Label" column is the name of the corresponding enum
- element.</P>
- <a name="example"></a>
- <H3>An example</H3>
- <P>The best way to underestand the format is to look at an example. Let's see how
- the following structure of classes would be serialized:</P>
- <BLOCKQUOTE dir="ltr" style="MARGIN-RIGHT: 0px">
- <P><FONT face="Courier New">class A<BR>
- {<BR>
- B bval = new B();<BR>
- C cval = new C();<BR>
- string msg = "hello";<BR>
- }<BR>
- <BR>
- class B<BR>
- {<BR>
- string str = "bye";<BR>
- }<BR>
- <BR>
- struct C<BR>
- {<BR>
- string[] info = new string[] {"hello","world"}<BR>
- }</FONT></P>
- </BLOCKQUOTE>
- <P>The serialization of an instance of class A would result in a sequence of binary
- elements like the following:</P>
- <P>
- <TABLE id="Table35" cellSpacing="1" cellPadding="1" width="100%" border="1">
- <TR>
- <TD vAlign="top" width="169"><STRONG>Element</STRONG></TD>
- <TD vAlign="top" width="40"><STRONG>Bytes</STRONG></TD>
- <TD vAlign="top" width="186"><STRONG>Data</STRONG></TD>
- <TD vAlign="top"><STRONG>Comments</STRONG></TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169">Header</TD>
- <TD vAlign="top" width="40">0<BR>
- 1,0,0,0,<BR>
- 255,255,255,255,<BR>
- 1,0,0,0,0,0,0,0</TD>
- <TD vAlign="top" width="186">Element code ?</TD>
- <TD vAlign="top">This sequence of bytes is serialized at the beginning. I'm sure it
- has a meaning, but I don't know it.</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"><A href="#elem12">Assembly</A></TD>
- <TD vAlign="top" width="40">1<BR>
- 1,0,0,0<BR>
- "MyAssembly"</TD>
- <TD vAlign="top" width="186">Element code<BR>
- ID of the assembly (1)<BR>
- Full name of the assembly</TD>
- <TD vAlign="top">
- <P>Before serializing an object, the assembly where the object is implemented has
- to be serialized. The formatter assigns an ID to the assembly (ID 1 in this
- case). This ID will by used to refer to this assembly.</P>
- </TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"><A href="#elem5">ExternalObject</A></TD>
- <TD vAlign="top" width="40">5<BR>
- 2,0,0,0<BR>
- "A"<BR>
- 3,0,0,0<BR>
- "bval","cval","msg"<BR>
- 4,4,1<BR>
- "B"<BR>
- 1,0,0,0<BR>
- "C"<BR>
- 1,0,0,0<BR>
- 1,0,0,0</TD>
- <TD vAlign="top" width="186">Element code<BR>
- Object ID (2)<BR>
- Class name<BR>
- Field count<BR>
- Field names<BR>
- Field type tags<BR>
- Class name of field "bval"<BR>
- Assembly ID of field "bval"<BR>
- Class name of field "cval"<BR>
- Assembly ID of field "cval"<BR>
- Assembly ID of this object</TD>
- <TD vAlign="top">Serialization of the root object. Each object has an ID that is
- used, for example, to specify object relations. The object binary element has
- two parts. The first one is type metadata: the name and type of serialized
- fields. The second part is the object data: field values. The data part is
- shown in the following nested elements.</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"> <A href="#elem9">ObjectReference</A></TD>
- <TD vAlign="top" width="40">9<BR>
- 5,0,0,0</TD>
- <TD vAlign="top" width="186">Element code<BR>
- ID of the referred object (5)</TD>
- <TD vAlign="top">Reference objects are not serialized inside the container element.
- Instead, an ObjectReference is serialized, and the object itself queued for
- later serialization.</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"> <A href="#elem5">ExternalObject</A></TD>
- <TD vAlign="top" width="40">5<BR>
- 3,0,0,0<BR>
- C<BR>
- 1,0,0,0<BR>
- "info"<BR>
- 6<BR>
- 1,0,0,0</TD>
- <TD vAlign="top" width="186">Element code<BR>
- Object ID (3)<BR>
- Class name<BR>
- Field count<BR>
- Field name<BR>
- Field type tag<BR>
- Assembly ID of this object</TD>
- <TD vAlign="top">On the other hand, value type objects are serialized inside the
- container element.</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169">
- <A href="#elem9">ObjectReference</A></TD>
- <TD vAlign="top" width="40">9<BR>
- 7,0,0,0</TD>
- <TD vAlign="top" width="186">Element code<BR>
- ID of the referred object (7)</TD>
- <TD vAlign="top">This is again a reference object, so it is serialized later.</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"> <A href="#elem6">String</A></TD>
- <TD vAlign="top" width="40">6<BR>
- 4,0,0,0<BR>
- "hello"</TD>
- <TD vAlign="top" width="186">Element code<BR>
- Object ID (4)<BR>
- String value</TD>
- <TD vAlign="top">Strings are serialized like value objects</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"><A href="#elem5">ExternalObject</A></TD>
- <TD vAlign="top" width="40">5<BR>
- 5,0,0,0<BR>
- "B"<BR>
- 1,0,0,0<BR>
- "str"<BR>
- 1<BR>
- 1,0,0,0</TD>
- <TD vAlign="top" width="186">Element code<BR>
- Object ID (5)<BR>
- Class name<BR>
- Field count<BR>
- Field name<BR>
- Field type tag<BR>
- Assembly ID of this object</TD>
- <TD vAlign="top">
- <P>Reference objects queued for serialization are serialized after the root object.</P>
- </TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"> <A href="#elem6">String</A></TD>
- <TD vAlign="top" width="40">6<BR>
- 6,0,0,0<BR>
- "bye"</TD>
- <TD vAlign="top" width="186">Element code<BR>
- Object ID (6)<BR>
- String value</TD>
- <TD vAlign="top">A string</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"><A href="#elem17">ArrayOfString</A></TD>
- <TD vAlign="top" width="40">17<BR>
- 7,0,0,0<BR>
- 2,0,0,0</TD>
- <TD vAlign="top" width="186">Element code<BR>
- Object ID (7)<BR>
- Element count</TD>
- <TD vAlign="top">This could be also encoded using the binary element Array
- (7), but ArrayOfString is more specific and saves bytes.</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"> <A href="#elem9">ObjectReference</A></TD>
- <TD vAlign="top" width="40">9<BR>
- 4,0,0,0</TD>
- <TD vAlign="top" width="186">Element code<BR>
- ID of the referred object (4)</TD>
- <TD vAlign="top">This string was already serialized. Use a backwards reference.</TD>
- </TR>
- <TR>
- <TD vAlign="top" width="169"> <A href="#elem6">String</A></TD>
- <TD vAlign="top" width="40">6<BR>
- 8,0,0,0<BR>
- "world"</TD>
- <TD vAlign="top" width="186">Element code<BR>
- Object ID (8)<BR>
- String value</TD>
- <TD vAlign="top">Another string</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elements"></a>
- <H2>Binary elements</H2>
- <P>The following sections show the format of each binary element. The format is
- presented in a table with two columns. The first one shows the sequence of
- bytes and the second one a description of each element in the sequence.</P>
- <P>A special notation is used to represent the bytes. Here are some examples:</P>
- <P>
- <TABLE id="Table36" style="WIDTH: 448px; HEIGHT: 129px" cellSpacing="1" cellPadding="1" width="448" border="1">
- <TR>
- <TD width="193"><STRONG>Example of element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="193">(byte) 7</TD>
- <TD>A single byte</TD>
- </TR>
- <TR>
- <TD width="193">uint</TD>
- <TD>Any uint value (4 bytes)</TD>
- </TR>
- <TR>
- <TD width="193"><EM><A href="#type-tag">type-tag</A></EM></TD>
- <TD>Names in italic are described in the section "Other elements"</TD>
- </TR>
- <TR>
- <TD width="193"><EM><A href="#string">string</A></EM> *</TD>
- <TD>* represents a sequence of elements</TD>
- </TR>
- <TR>
- <TD width="193">object</TD>
- <TD>Full serialization of an object</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem1"></a>
- <H3>1 - RefTypeObject
- </H3>
- <P>An object is serialized in two parts. The first one is type metadata, and the
- second one is the object data. When several objects of the same type are
- serialized, only the first one has the metadata part. The other objects are
- serialized using the RefTypeObject element, which instead of the metadata, it
- includes an ID of an object that is of the same type as the one being
- serialized.</P>
- <P>
- <TABLE id="Table2" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 1</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>ID of a previously serialized object from which to take type metadata.</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#value">value</A> </EM>*</TD>
- <TD>Values of the fields of the object</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem4"></a>
- <H3>4 - RuntimeObject</H3>
- <P>This element is used to serialize objects of types that are implemented in the
- core library of the framework. The only difference from the format for other
- objects if that it does not include assembly information, which is not needed
- since the assembly will always be mscorlib.</P>
- <P>
- <TABLE id="Table21" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 4</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#string">string</A></EM></TD>
- <TD>Class name, including namespace</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Number of serialized fields</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#string">string</A> </EM>*</TD>
- <TD>Names of the fields</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-tag">type-tag</A> *</EM></TD>
- <TD>type-tag of each field</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-spec">type-spec</A> *</EM></TD>
- <TD>type-spec of each field</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#value">value</A> *</EM></TD>
- <TD>Values of the fields of the object</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem5"></a>
- <H3>5 - ExternalObject</H3>
- <P>This element can be used to serialize any object from any assembly.</P>
- <H3>
- <TABLE id="Table22" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 5</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#string">string</A></EM></TD>
- <TD>Class name, including namespace</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Number of serialized fields</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#string">string</A> </EM>*</TD>
- <TD>Names of the fields</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-tag">type-tag</A> </EM>*</TD>
- <TD>type-tag of each field</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-spec">type-spec</A> </EM>*</TD>
- <TD>type-spec of each field</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>ID of the assembly where the class is defined (the assembly must have been
- serialized before the class using the binary element 12)</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#value">value</A> </EM>*</TD>
- <TD>Values of the fields of the object</TD>
- </TR>
- </TABLE>
- </H3>
- <a name="elem6"></a>
- <H3>6 - String</H3>
- <P>A string value.</P>
- <P>
- <TABLE id="Table23" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 6</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#string">string</A></EM></TD>
- <TD>Value of the string</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem7"></a>
- <H3>7 - GenericArray</H3>
- <P>This element can be used to represent any array.</P>
- <H3>
- <TABLE id="Table24" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 7</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142">byte</TD>
- <TD>Array type: 0:single dimension, 1: jagged, 2: multi-dimensional</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Number of dimensions (rank)</TD>
- </TR>
- <TR>
- <TD width="142">uint *</TD>
- <TD>Number of elements for each dimension</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-tag">type-tag</A></EM></TD>
- <TD>type-tag of array's element type</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-spec">type-spec</A></EM></TD>
- <TD>type-spec of array's element type</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#value">value</A> *</EM></TD>
- <TD>Values of the elements, row by row</TD>
- </TR>
- </TABLE>
- </H3>
- <a name="elem8"></a>
- <H3>8 - BoxedPrimitiveTypeValue</H3>
- <P>This element represents a primitive type value boxed as an object.</P>
- <P>
- <TABLE id="Table25" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 8</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-spec">type-spec</A></EM></TD>
- <TD>type-spec of the primitive type</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#primitive-value">primitive-value</A></EM></TD>
- <TD>Raw value</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem9"></a>
- <H3>9 - ObjectReference</H3>
- <P>This element represents a reference to an object already serialized (backwards
- reference) or that will be serialized later (forward reference).
- </P>
- <P>
- <TABLE id="Table26" style="WIDTH: 568px; HEIGHT: 16px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 9</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>ID of the referred object</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem10"></a>
- <H3>10 - NullValue</H3>
- <P>A null value.</P>
- <TABLE id="Table27" style="WIDTH: 568px; HEIGHT: 16px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 10</TD>
- <TD>Element code</TD>
- </TR>
- </TABLE>
- <P></P>
- <a name="elem11"></a>
- <H3>
- <P>11 - End</P>
- </H3>
- <P>This element marks the end of the serialized object graph.</P>
- <TABLE id="Table28" style="WIDTH: 568px; HEIGHT: 16px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 11</TD>
- <TD>Element code</TD>
- </TR>
- </TABLE>
- <a name="elem12"></a>
- <H3>
- <P>12 - Assembly</P>
- </H3>
- <P>Defines an assembly. Each assembly is defined only once and has an ID. This ID
- is used when serializing an object (element 5) to specify the assembly where
- object's type is implemented.</P>
- <TABLE id="Table29" style="WIDTH: 568px; HEIGHT: 16px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 12</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Assembly ID</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#string">string</A></EM></TD>
- <TD>Full name of the assembly</TD>
- </TR>
- </TABLE>
- <a name="elem13"></a>
- <H3>
- <P>13 - ArrayFiller8b</P>
- </H3>
- <P>This element can be used when serializing array data to specify multiple
- consecutive null values. It it only used in single dimension arrays of
- reference objects (not valid for value-type objects).</P>
- <TABLE id="Table30" style="WIDTH: 568px; HEIGHT: 16px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 13</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">byte</TD>
- <TD>Number of consecutive null values</TD>
- </TR>
- </TABLE>
- <P></P>
- <a name="elem14"></a>
- <H3>
- <P>14 - ArrayFiller32b</P>
- </H3>
- <P>The same as ArrayFiller8b, but it uses a uint to specify the length.</P>
- <TABLE id="Table31" style="WIDTH: 568px; HEIGHT: 16px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 14</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Number of consecutive null values</TD>
- </TR>
- </TABLE>
- <P></P>
- <a name="elem15"></a>
- <H3>
- <P>15 - ArrayOfPrimitiveType</P>
- </H3>
- <P>This element can be used to represent a single dimension array of primitive type
- values.</P>
- <P>
- <TABLE id="Table32" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 15</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Number of elements</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#type-spec">type-spec</A></EM></TD>
- <TD>type-spec of array's element type</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#primitive-value">primitie-value</A> *</EM></TD>
- <TD>Values of the elements</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem16"></a>
- <H3>16 - ArrayOfObject</H3>
- <P>This element can be used to represent a single dimension array of Object (i.e.
- an object[] ).</P>
- <P>
- <TABLE id="Table33" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 16</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Number of elements</TD>
- </TR>
- <TR>
- <TD width="142">object *</TD>
- <TD>Values of the elements</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem17"></a>
- <H3>17 - ArrayOfString</H3>
- <P>This element can be used to represent a single dimension array of String
- (i.e. an string[] ).</P>
- <P>
- <TABLE id="Table34" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 17</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Object ID</TD>
- </TR>
- <TR>
- <TD width="142">uint</TD>
- <TD>Number of elements</TD>
- </TR>
- <TR>
- <TD width="142">object *</TD>
- <TD>Values of the elements</TD>
- </TR>
- </TABLE>
- </P>
- <a name="elem21"></a>
- <H3>21 Method call</H3>
- <P>Represents a method call. The format of a method call can vary depending on the
- type of the parameters. The following table shows the common format:</P>
- <P>
- <TABLE id="Table20" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142">(byte) 21</TD>
- <TD>Element code</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#method-call-flags">method-call-flags</A></EM></TD>
- <TD>Describes wich information includes the method call</TD>
- </TR>
- <TR>
- <TD width="142">(byte) 0, 0, 0</TD>
- <TD>???</TD>
- </TR>
- <TR>
- <TD width="142"><EM><EM><A href="#type-spec">type-spec</A><BR>
- <EM><A href="#primitive-value">primitive-value</A></EM></EM></EM></TD>
- <TD>Method name</TD>
- </TR>
- <TR>
- <TD width="142"><EM><EM><EM><A href="#type-spec">type-spec</A><BR>
- <EM><A href="#primitive-value">primitive-value</A></EM></EM></EM></EM></TD>
- <TD>Class name (including namespace and assembly)</TD>
- </TR>
- </TABLE>
- </P>
- <P>The following tables describe the format of the message content depending on the
- value of method-call-flags:</P>
- <H4>method-call-flags & NoArguments</H4>
- <P>Used for calls to methods without parameters.</P>
- <H4>
- <TABLE id="Table8" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="119"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="119">Header[]</TD>
- <TD>Only if there are Headers and method-call-flags has the flag <EM>IncludeLogicalCallContext.
- </EM>Headers are serialized only if there is context info. This must be a bug
- in MS.NET.</TD>
- </TR>
- <TR>
- <TD width="119">object[]</TD>
- <TD>
- <P>Array with the following values:</P>
- <UL>
- <LI>
- Method signature, only if method-call-flags has the flag IncludesSignature. It
- is an array of Type.
- <LI>
- LogicalCallContext instance, only if method-call-flags has the flag
- IncludesLogicalCallContext.</LI></UL>
- <P>If the array is empty, it is not serialized.</P>
- </TD>
- </TR>
- </TABLE>
- </H4>
- <H4>method-call-flags & PrimitiveArguments</H4>
- <P>Used for calls to methods in which all parameters are primitive types.</P>
- <P>
- <TABLE id="Table5" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="119"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="119">uint</TD>
- <TD>Number of parameters</TD>
- </TR>
- <TR>
- <TD width="119"><EM><EM><EM><EM>( <A href="#type-spec">type-spec</A></EM></EM></EM><BR>
- <A href="#primitive-value">primitive-value</A> ) *</EM></TD>
- <TD>One value for each parameter</TD>
- </TR>
- <TR>
- <TD width="119">Header[]</TD>
- <TD>Only if there are Headers and method-response-flags has the flag <EM>IncludeLogicalCallContext.
- </EM>Headers are serialized only if there is context info. This must be a bug
- in MS.NET.</TD>
- </TR>
- <TR>
- <TD width="119">object[]</TD>
- <TD>
- <P>Array with the following values:</P>
- <UL>
- <LI>
- Method signature, only if method-call-flags has the flag IncludesSignature. It
- is an array of Type.
- <LI>
- LogicalCallContext instance, only if method-call-flags has the flag
- IncludesLogicalCallContext.</LI></UL>
- <P>If the array is empty, it is not serialized.</P>
- </TD>
- </TR>
- </TABLE>
- </P>
- <H4>method-call-flags & ArgumentsInSimpleArray</H4>
- <P>Used for calls to methods in which at least one parameter is not a primitive
- type, and when no other info needs to be serialized (i.e. context or
- signature).</P>
- <P>
- <TABLE id="Table6" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="119"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="119">Header[]</TD>
- <TD>Only if there are Headers.</TD>
- </TR>
- <TR>
- <TD width="119">object[]</TD>
- <TD>
- <P>Array of parameters.
- </P>
- </TD>
- </TR>
- </TABLE>
- <H4>method-call-flags & ArgumentsInMultiArray</H4>
- <P>Used for calls to methods in which at least one parameter is not a primitive
- type, and when other info needs to be serialized (i.e. context or signature).</P>
- <P>
- <TABLE id="Table7" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="119"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="119">Header[]</TD>
- <TD>Only if there are Headers.</TD>
- </TR>
- <TR>
- <TD width="119">object[]</TD>
- <TD>
- <P>
- Array with the following values:</P>
- <UL>
- <LI>
- Array of parameters.
- <LI>
- Method signature, only if method-call-flags has the flag IncludesSignature. It
- is an array of Type.
- <LI>
- LogicalCallContext instance, only if method-call-flags has the flag
- IncludesLogicalCallContext.</LI></UL>
- <P>
- If the array is empty, it is not serialized.</P>
- </TD>
- </TR>
- </TABLE>
- </P>
- </TD></TR></TBODY></TABLE> <a name="elem22"></a>
- <H3>22 Method Response</H3>
- <P>Represents a method response. The format of a method response can vary depending
- on the type of the return value and parameters. The following table
- shows the common format:</P>
- <P>
- <TABLE id="Table9" style="WIDTH: 568px; HEIGHT: 140px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="142"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="142" height="25">(byte) 22</TD>
- <TD height="25">Element code</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#method-response-flags">method-response-flags</A></EM></TD>
- <TD>Describes which information includes the method call</TD>
- </TR>
- <TR>
- <TD width="142"><EM><A href="#return-type-tag">return-type-tag</A></EM></TD>
- <TD>Describes which kind of value is returned</TD>
- </TR>
- <TR>
- <TD width="142">(bytes) 0, 0</TD>
- <TD>???</TD>
- </TR>
- </TABLE>
- <P></P>
- <P>The following tables describe the format of the message content depending on the
- value of method-response-flags:</P>
- <H4>method-response-flags & NoArguments</H4>
- <P>Used when the method has no out arguments.</P>
- <P>
- <TABLE id="Table10" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="139"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="139"><EM><EM><EM><A href="#type-spec">type-spec</A><BR>
- <EM><A href="#primitive-value">primitive-value</A></EM></EM></EM></EM></TD>
- <TD>
- <P><EM>Only if return-type-tag was PrimitiveType.<BR>
- </EM>Return value.</P>
- </TD>
- </TR>
- <TR>
- <TD width="139">Header[]</TD>
- <TD>Only if there are Headers.</TD>
- </TR>
- <TR>
- <TD width="139">object[]</TD>
- <TD>
- <P>Array with the following values:</P>
- <UL>
- <LI>
- Return value, only if <EM>return-type-tag</EM> was <EM>ObjectType</EM>
- <LI>
- LogicalCallContext instance, only if method-response-flags has the flag
- IncludeLogicalCallContext</LI></UL>
- <P>If the array is empty, it is not serialized.</P>
- </TD>
- </TR>
- </TABLE>
- </P>
- <H4>method-response-flags & PrimitiveArguments</H4>
- <P>Used when all out arguments are primitive types.</P>
- <H2>
- <TABLE id="Table12" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="139"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="139"><EM><EM><EM><A href="#type-spec">type-spec</A><BR>
- <EM><A href="#primitive-value">primitive-value</A></EM></EM></EM></EM></TD>
- <TD>
- <P><EM>Only if return-type-tag was PrimitiveType.<BR>
- </EM>Return value.</P>
- </TD>
- </TR>
- <TR>
- <TD width="139">uint</TD>
- <TD>Number of out arguments</TD>
- </TR>
- <TR>
- <TD width="139"><EM><EM><EM>( <A href="#type-spec">type-spec</A>
- <BR>
- <EM><A href="#primitive-value">primitive-value</A> )</EM></EM></EM> *</EM></TD>
- <TD>One value for each argument</TD>
- </TR>
- <TR>
- <TD width="139">Header[]</TD>
- <TD>Only if there are Headers. Empty otherwise.</TD>
- </TR>
- <TR>
- <TD width="139">object[]</TD>
- <TD>
- <P>Array with the following values:</P>
- <UL>
- <LI>
- Return value, only if <EM>return-type-tag</EM> was <EM>ObjectType</EM>
- <LI>
- LogicalCallContext instance, only if method-response-flags has the flag
- IncludeLogicalCallContext</LI></UL>
- <P>If the array is empty, it is not serialized.</P>
- </TD>
- </TR>
- </TABLE>
- </H2>
- <H4>method-response-flags & ArgumentsInSimpleArray</H4>
- <P>Used when at least one out argument is not a primitive type, return type is
- primitive, and no other info needs to be serialized.</P>
- <H2>
- <TABLE id="Table13" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="140"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="140"><EM><EM><EM><A href="#type-spec">type-spec</A><BR>
- <EM><A href="#primitive-value">primitive-value</A></EM></EM></EM></EM></TD>
- <TD>
- <P><EM>Only if return-type-tag was PrimitiveType.<BR>
- </EM>Return value.</P>
- </TD>
- </TR>
- <TR>
- <TD width="140">Header[]</TD>
- <TD>Only if there are Headers.</TD>
- </TR>
- <TR>
- <TD width="140">object[]</TD>
- <TD>Array that contains the out arguments</TD>
- </TR>
- </TABLE>
- </H2>
- <H4>method-response-flags & ArgumentsInMultiArray</H4>
- <P>Used when at least one out argument is not a primitive type, return type is not
- primitive, and no other info needs to be serialized.</P>
- <H2>
- <TABLE id="Table14" style="WIDTH: 568px; HEIGHT: 75px" cellSpacing="1" cellPadding="1" width="568" border="1">
- <TR>
- <TD width="141"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="141"><EM><EM><EM><A href="#type-spec">type-spec</A><BR>
- <EM><A href="#primitive-value">primitive-value</A></EM></EM></EM></EM></TD>
- <TD>
- <P>Only if <EM>return-type-tag </EM>was <EM>PrimitiveType.<BR>
- </EM>Return value.</P>
- </TD>
- </TR>
- <TR>
- <TD width="141">Header[]</TD>
- <TD>Only if there are Headers</TD>
- </TR>
- <TR>
- <TD width="141">object[]</TD>
- <TD>
- <P>Array with the following values:</P>
- <UL>
- <LI>
- Array of out arguments.
- <LI>
- Return value, only if <EM>return-type-tag</EM> was <EM>ObjectType</EM>
- <LI>
- LogicalCallContext instance, only if method-response-flags has the flag
- IncludeLogicalCallContext</LI></UL>
- </TD>
- </TR>
- </TABLE>
- </H2>
- <a name="other"></a>
- <H2>Other elements</H2>
- <a name="string"></a>
- <H3>string</H3>
- <P>A string value, serialized using BinaryWriter. It serializes the length of the
- string, using a 7-bit encoded int, and then the string chars.</P>
- <a name="primitive-value"></a>
- <H3>primitive-value</H3>
- <P>A primitive value. It can be serialized using BinaryWriter and deserialized
- using BinaryReader. DateTime is serialized as a long (using the Ticks
- property).
- </P>
- <a name="value"></a>
- <H3>value</H3>
- <P>It can be a <A href="#primitive-value">primitive-value</A> or any of the
- following binary elements:</P>
- <UL>
- <LI>
- <A href="#elem1">1 - RefTypeObject</A>
- (only for value types)
- <LI>
- <A href="#elem4">4 - RuntimeObject</A>
- (only for value types)
- <LI>
- <A href="#elem5">5 - ExternalObject</A> (only for value types)
- <LI>
- <A href="#elem6">6 - String</A>
- <LI>
- <A href="#elem8">8 - BoxedPrimitiveTypeValue</A>
- <LI>
- <A href="#elem9">9 - ObjectReference</A>
- <LI>
- <A href="#elem10">10 - NullValue</A>
- <LI>
- <A href="#elem13">13 - ArrayFiller8b</A> (only inside
- single-dimensional object arrays)
- <LI>
- <A href="#elem14">14 - ArrayFiller32b</A> (only inside single-dimensional
- object arrays)</LI></UL>
- <a name="type-tag"></a>
- <H3>type-tag</H3>
- <P>Together with a <A href="#type-spec">type-spec</A> value, identifies a type.
- Some types can be represented using several type-tags. In this case, the most
- specific type-tag is allways used (it will take less bytes).</P>
- <P>type-tag can be one of the following:</P>
- <P>
- <TABLE id="Table18" cellSpacing="1" cellPadding="1" width="600" border="1">
- <TR>
- <TD><STRONG>Value</STRONG></TD>
- <TD><STRONG>Label</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- <TD><STRONG>type-spec needed</STRONG></TD>
- </TR>
- <TR>
- <TD>0</TD>
- <TD>PrimitiveType</TD>
- <TD>A primitive type</TD>
- <TD>The code of the primitive type</TD>
- </TR>
- <TR>
- <TD>1</TD>
- <TD>String</TD>
- <TD>String class. type-spec is not needed.</TD>
- <TD>Not needed</TD>
- </TR>
- <TR>
- <TD>2</TD>
- <TD>ObjectType</TD>
- <TD>Object class. type-spec is not needed.</TD>
- <TD>Not needed</TD>
- </TR>
- <TR>
- <TD height="20">3</TD>
- <TD height="20">RuntimeType</TD>
- <TD height="20">A type from the .NET runtime (including arrays of .NET types)</TD>
- <TD height="20">The name of the class</TD>
- </TR>
- <TR>
- <TD>4</TD>
- <TD>GenericType</TD>
- <TD>Any other type (including arrays)</TD>
- <TD>The name of the class and the id of the assembly</TD>
- </TR>
- <TR>
- <TD>5</TD>
- <TD>ArrayOfObject</TD>
- <TD>Array of class Object</TD>
- <TD>Not needed</TD>
- </TR>
- <TR>
- <TD>6</TD>
- <TD>ArrayOfString</TD>
- <TD>Array of class String</TD>
- <TD>Not needed</TD>
- </TR>
- <TR>
- <TD>7</TD>
- <TD>ArrayOfPrimitiveType</TD>
- <TD>Array of primitive type</TD>
- <TD>The code of the primitive type</TD>
- </TR>
- </TABLE>
- </P>
- <a name="type-spec"></a>
- <H3>type-spec</H3>
- <P>It is the name or the code of a type. To decode it, a <A href="#type-tag">type-tag</A>
- value is needed. The following tables shows the format of type-spec for each
- type-tag value:</P>
- <H4>type-tag = PrimitiveType or ArrayOfPrimitiveType</H4>
- <P>
- <TABLE id="Table16" style="WIDTH: 560px; HEIGHT: 14px" cellSpacing="1" cellPadding="1" width="560" border="1">
- <TR>
- <TD width="119"><STRONG>Element</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD width="119"><A href="#primitive-type-code">primitive-type-code</A></TD>
- <TD>
- The code of the primitive type</TD>
- </TR>
- </TABLE>
- </P>
- <H4>type-tag = RuntimeType</H4>
- <P>
- <TABLE id="Table15" style="WIDTH: 560px; HEIGHT: 14px" cellSpacing="1" cellPadding="1" width="560" border="1">
- <TR>
- <TD><STRONG><STRONG>Element</STRONG></STRONG></TD>
- <TD><STRONG><STRONG>Description</STRONG></STRONG></TD>
- </TR>
- <TR>
- <TD><EM><A href="#string">string</A></EM></TD>
- <TD>The name of the class, including the namespace</TD>
- </TR>
- </TABLE>
- <H4>type-tag = GenericType</H4>
- <P>
- <TABLE id="Table17" style="WIDTH: 560px; HEIGHT: 14px" cellSpacing="1" cellPadding="1" width="560" border="1">
- <TR>
- <TD><STRONG>Element</STRONG></TD>
- <TD><STRONG><STRONG>Description</STRONG></STRONG></TD>
- </TR>
- <TR>
- <TD><EM><A href="#string">string</A></EM></TD>
- <TD>The name of the class, including the namespace</TD>
- </TR>
- <TR>
- <TD>uint</TD>
- <TD>Id of the assembly where the class is defined</TD>
- </TR>
- </TABLE>
- <H3>
- <H4>Other type-tag</H4>
- </H3>
- <P>For other type-tag values, no type-spec is needed.</P>
- <a name="method-call-flags"></a>
- <H3>method-call-flags</H3>
- <P>
- <TABLE id="Table3" cellSpacing="1" cellPadding="1" width="600" border="1">
- <TR>
- <TD><STRONG>Value</STRONG></TD>
- <TD><STRONG>Label</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD>1</TD>
- <TD>NoArguments</TD>
- <TD>No arguments included</TD>
- </TR>
- <TR>
- <TD>2</TD>
- <TD>PrimitiveArguments</TD>
- <TD>Primitive type arguments</TD>
- </TR>
- <TR>
- <TD>4</TD>
- <TD>ArgumentsInSimpleArray</TD>
- <TD>At least one out argument is not from a primitive type</TD>
- </TR>
- <TR>
- <TD height="20">8</TD>
- <TD height="20">ArgumentsInMultiArray</TD>
- <TD height="20">At least one out argument is not from a primitive type and other
- info is included in the message (context or signature)</TD>
- </TR>
- <TR>
- <TD>16</TD>
- <TD>ExcludeLogicalCallContext</TD>
- <TD>LogicalContext not included</TD>
- </TR>
- <TR>
- <TD>32</TD>
- <TD></TD>
- <TD>???</TD>
- </TR>
- <TR>
- <TD>64</TD>
- <TD>IncludesLogicalCallContext</TD>
- <TD>LogicalContext included</TD>
- </TR>
- <TR>
- <TD>128</TD>
- <TD>IncludesSignature</TD>
- <TD>Signature is included in the message. It is only included when calling an
- overloaded method.</TD>
- </TR>
- </TABLE>
- </P>
- <a name="method-response-flags"></a>
- <H3>method-response-flags</H3>
- <P>
- <TABLE id="Table4" cellSpacing="1" cellPadding="1" width="600" border="1">
- <TR>
- <TD><STRONG>Value</STRONG></TD>
- <TD width="190"><STRONG>Label</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD>1</TD>
- <TD width="190">NoArguments</TD>
- <TD>Response with no out arguments</TD>
- </TR>
- <TR>
- <TD>2</TD>
- <TD width="190">PrimitiveArguments</TD>
- <TD>
- Response with primitive type out arguments</TD>
- </TR>
- <TR>
- <TD>4</TD>
- <TD width="190">ArgumentsInSimpleArray</TD>
- <TD>Response with primitive type return value, and with at least one out argument
- that is not a primitive type.</TD>
- </TR>
- <TR>
- <TD>8</TD>
- <TD width="190">ArgumentsInMultiArray</TD>
- <TD>Response with at least one out argument that is not a primitive type, and other
- info is included in the message (context or signature)</TD>
- </TR>
- <TR>
- <TD>16</TD>
- <TD width="190">ExcludeLogicalCallContext</TD>
- <TD>LogicalContext not included</TD>
- </TR>
- <TR>
- <TD>32</TD>
- <TD width="190"></TD>
- <TD>???</TD>
- </TR>
- <TR>
- <TD>64</TD>
- <TD width="190">IncludesLogicalCallContext</TD>
- <TD>LogicalContext included</TD>
- </TR>
- </TABLE>
- </P>
- <a name="return-type-tag"></a>
- <H3>return-type-tag</H3>
- <P>
- <TABLE id="Table11" cellSpacing="1" cellPadding="1" width="600" border="1">
- <TR>
- <TD><STRONG>Value</STRONG></TD>
- <TD><STRONG>Label</STRONG></TD>
- <TD><STRONG>Description</STRONG></TD>
- </TR>
- <TR>
- <TD>2</TD>
- <TD>Null</TD>
- <TD>Null return value</TD>
- </TR>
- <TR>
- <TD>8</TD>
- <TD>PrimitiveType</TD>
- <TD>Primitive type return value</TD>
- </TR>
- <TR>
- <TD>16</TD>
- <TD>ObjectType</TD>
- <TD>Object instance return value</TD>
- </TR>
- <TR>
- <TD>32</TD>
- <TD>Exception</TD>
- <TD>Method response is an exception</TD>
- </TR>
- </TABLE>
- </P>
- <a name="primitive-type-code"></a>
- <H3>primitive-type-code</H3>
- <P>
- <TABLE id="Table19" height="171" cellSpacing="1" cellPadding="1" width="320" border="1">
- <TR>
- <TD width="45"><STRONG>Value</STRONG></TD>
- <TD width="190"><STRONG>Label</STRONG></TD>
- </TR>
- <TR>
- <TD width="45">1</TD>
- <TD width="190">Boolean
- </TD>
- </TR>
- <TR>
- <TD width="45">2</TD>
- <TD width="190">Byte</TD>
- </TR>
- <TR>
- <TD width="45">3</TD>
- <TD width="190">Char</TD>
- </TR>
- <TR>
- <TD width="45">5</TD>
- <TD width="190">Decimal</TD>
- </TR>
- <TR>
- <TD width="45">6</TD>
- <TD width="190">Double</TD>
- </TR>
- <TR>
- <TD width="45">7</TD>
- <TD width="190">Int16</TD>
- </TR>
- <TR>
- <TD width="45">8</TD>
- <TD width="190">Int32</TD>
- </TR>
- <TR>
- <TD width="45">9</TD>
- <TD width="190">Int64</TD>
- </TR>
- <TR>
- <TD width="45">10</TD>
- <TD width="190">SByte</TD>
- </TR>
- <TR>
- <TD width="45">11</TD>
- <TD width="190">Single</TD>
- </TR>
- <TR>
- <TD width="45">13</TD>
- <TD width="190">DateTime</TD>
- </TR>
- <TR>
- <TD width="45">14</TD>
- <TD width="190">UInt16</TD>
- </TR>
- <TR>
- <TD width="45">15</TD>
- <TD width="190">UInt32</TD>
- </TR>
- <TR>
- <TD width="45">16</TD>
- <TD width="190">UInt64</TD>
- </TR>
- <TR>
- <TD width="45">18</TD>
- <TD width="190">String</TD>
- </TR>
- </TABLE>
- </P>
- <HR width="100%" SIZE="1">
- <FONT size="1">2003 (C) Lluis Sanchez Gual (</FONT> <A href="mailto:[email protected]">
- <FONT size="1">[email protected]</FONT></A><FONT size="1">)</FONT>
- <P> </P>
- </body>
- </html>
|