4 <name>Microsoft.Diagnostics.FastSerialization</name>
7 <member name="T:FastSerialization.StreamLabel">
9 A StreamLabel represents a position in a IStreamReader or IStreamWriter.
10 In memory it is represented as a 64 bit signed value but to preserve compat
11 with the FastSerializer.1 format it is a 32 bit unsigned value when
12 serialized in a file. FastSerializer can parse files exceeding 32 bit sizes
13 as long as the format doesn't persist a StreamLabel in the content. NetTrace
14 is an example of this.
15 During writing it is generated by the IStreamWriter.GetLabel method an
16 consumed by the IStreamWriter.WriteLabel method. On reading you can use
17 IStreamReader.Current and and IStreamReader.
20 <member name="F:FastSerialization.StreamLabel.Invalid">
22 Represents a stream label that is not a valid value
25 <member name="T:FastSerialization.IStreamWriter">
27 IStreamWriter is meant to be a very simple streaming protocol. You can write integral types,
28 strings, and labels to the stream itself.
30 IStreamWrite can be thought of a simplified System.IO.BinaryWriter, or maybe the writer
31 part of a System.IO.Stream with a few helpers for primitive types.
33 See also IStreamReader
36 <member name="M:FastSerialization.IStreamWriter.Write(System.Byte)">
38 Write a byte to a stream
41 <member name="M:FastSerialization.IStreamWriter.Write(System.Int16)">
43 Write a short to a stream
46 <member name="M:FastSerialization.IStreamWriter.Write(System.Int32)">
48 Write an int to a stream
51 <member name="M:FastSerialization.IStreamWriter.Write(System.Int64)">
53 Write a long to a stream
56 <member name="M:FastSerialization.IStreamWriter.Write(FastSerialization.StreamLabel)">
58 Write a StreamLabel (a pointer to another part of the stream) to a stream
61 <member name="M:FastSerialization.IStreamWriter.Write(System.String)">
63 Write a string to a stream (supports null values).
66 <member name="M:FastSerialization.IStreamWriter.GetLabel">
68 Get the stream label for the current position (points at whatever is written next
72 <member name="M:FastSerialization.IStreamWriter.WriteSuffixLabel(FastSerialization.StreamLabel)">
74 Write a SuffixLabel it must be the last thing written to the stream. The stream
75 guarantees that this value can be efficiently read at any time (probably by seeking
76 back from the end of the stream)). The idea is that when you generate a 'tableOfContents'
77 you can only do this after processing the data (and probably writing it out), If you
78 remember where you write this table of contents and then write a suffix label to it
79 as the last thing in the stream using this API, you guarantee that the reader can
80 efficiently seek to the end, read the value, and then goto that position. (See
81 IStreamReader.GotoSuffixLabel for more)
84 <member name="T:FastSerialization.IStreamReader">
85 IStreamReader is meant to be a very simple streaming protocol. You can read integral types,
86 strings, and labels to the stream itself. You can also goto labels you have read from the stream.
88 IStreamReader can be thought of a simplified System.IO.BinaryReder, or maybe the reader
89 part of a System.IO.Stream with a few helpers for primitive types.
91 See also IStreamWriter
93 <member name="M:FastSerialization.IStreamReader.ReadByte">
95 Read a byte from the stream
98 <member name="M:FastSerialization.IStreamReader.ReadInt16">
100 Read a short from the stream
103 <member name="M:FastSerialization.IStreamReader.ReadInt32">
105 Read an int from the stream
108 <member name="M:FastSerialization.IStreamReader.ReadInt64">
110 Read a long from the stream
113 <member name="M:FastSerialization.IStreamReader.ReadString">
115 Read a string from the stream. Can represent null strings
118 <member name="M:FastSerialization.IStreamReader.Read(System.Byte[],System.Int32,System.Int32)">
120 Read a span of bytes from the stream.
123 <member name="M:FastSerialization.IStreamReader.ReadLabel">
125 Read a StreamLabel (pointer to some other part of the stream) from the stream
128 <member name="M:FastSerialization.IStreamReader.Goto(FastSerialization.StreamLabel)">
130 Goto a location in the stream
133 <member name="P:FastSerialization.IStreamReader.Current">
135 Returns the current position in the stream.
138 <member name="M:FastSerialization.IStreamReader.GotoSuffixLabel">
140 Sometimes information is only known after writing the entire stream. This information can be put
141 on the end of the stream, but there needs to be a way of finding it relative to the end, rather
142 than from the beginning. A IStreamReader, however, does not actually let you go 'backwards' easily
143 because it does not guarantee the size what it writes out (it might compress).
145 The solution is the concept of a 'suffixLabel' which is location in the stream where you can always
148 It is written with a special API (WriteSuffixLabel that must be the last thing written. It is
149 expected that it simply write an uncompressed StreamLabel. It can then be used by using the
150 GotoSTreamLabel() method below. This goes to this well know position in the stream. We expect
151 this is implemented by seeking to the end of the stream, reading the uncompressed streamLabel,
152 and then seeking to that position.
155 <member name="T:FastSerialization.IStreamWriterExentions">
157 Support for higher level operations on IStreamWriter and IStreamReader
160 <member name="M:FastSerialization.IStreamWriterExentions.Write(FastSerialization.IStreamWriter,System.Guid)">
162 Writes a Guid to stream 'writer' as sequence of 8 bytes
165 <member name="M:FastSerialization.IStreamWriterExentions.ReadGuid(FastSerialization.IStreamReader)">
167 Reads a Guid to stream 'reader' as sequence of 8 bytes and returns it
170 <member name="M:FastSerialization.IStreamWriterExentions.Add(FastSerialization.StreamLabel,System.Int32)">
172 Returns a StreamLabel that is the sum of label + offset.
175 <member name="M:FastSerialization.IStreamWriterExentions.Sub(FastSerialization.StreamLabel,FastSerialization.StreamLabel)">
177 Returns the difference between two stream labels
180 <member name="M:FastSerialization.IStreamWriterExentions.Skip(FastSerialization.IStreamReader,System.Int32)">
182 Convenience method for skipping a a certain number of bytes in the stream.
185 <member name="T:FastSerialization.ForwardReference">
187 Like a StreamLabel, a ForwardReference represents a pointer to a location in the stream.
188 However unlike a StreamLabel, the exact value in the stream does not need to be known at the
189 time the forward references is written. Instead the ID is written, and later that ID is
190 associated with the target location (using DefineForwardReference).
193 <member name="F:FastSerialization.ForwardReference.Invalid">
195 Returned when no appropriate ForwardReference exists.
198 <member name="T:FastSerialization.Serializer">
200 #SerializerIntroduction see also #StreamLayout
202 The Serializer class is a general purpose object graph serializer helper. While it does not have
203 any knowledge of the serialization format of individual object, it does impose conventions on how to
204 serialize support information like the header (which holds versioning information), a trailer (which
205 holds deferred pointer information), and how types are versioned. However these conventions are
206 intended to be very generic and thus this class can be used for essentially any serialization need.
209 * Allows full range of serialization, including subclassing and cyclic object graphs.
210 * Can be serialized and deserialized efficiently sequentially (no seeks MANDATED on read or
211 write). This allows the serializer to be used over pipes and other non-seekable devices).
212 * Pay for play (thus very efficient in simple cases (no subclassing or cyclic graphs).
213 * Ideally self-describing, and debuggable (output as XML if desired?)
216 * We want the ability for new formats to accept old versions if objects wish to support old
218 * Also wish to allow new formats to be read by OLD version if the new format is just an
219 'extension' (data added to end of objects). This makes making new versions almost pain-free.
222 * No-seek requirement
224 The serialized form should be such that it can be deserialized efficiently in a serial fashion
225 (no seeks). This means all information needed to deserialize has to be 'just in time' (can't
226 be some table at the end). Pragmatically this means that type information (needed to create
227 instances), has to be output on first use, so it is available for the deserializer.
229 * Laziness requirement
231 While is should be possible to read the serialized for sequentially, we should also not force
232 it. It should be possible to have a large file that represents a persisted structure that can
233 be lazily brought into memory on demand. This means that all information needed to
234 deserialize must also be 'randomly available' and not depend on reading from the beginning.
235 Pragmatically this means that type information, and forward forwardReference information needs to
236 have a table in a well known Location at the end so that it can be found without having to
237 search the file sequentially.
239 * Versioning requirement
241 To allow OLD code to access NEW formats, it must be the case that the serialized form of
242 every instance knows how to 'skip' past any new data (even if it does not know its exact
243 size). To support this, objects have 'begin' and 'end' tags, which allows the deserializer to
244 skip the next object.
246 * Polymorphism requirement
248 Because the user of a filed may not know the exact instance stored there, in general objects
249 need to store the exact type of the instance. Thus they need to store a type identifier, this
250 can be folded into the 'begin' tag.
252 * Arbitrary object graph (circularity) requirement (Forward references)
254 The serializer needs to be able to serialize arbitrary object graphs, including those with
255 cycles in them. While you can do this without forward references, the system is more flexible
256 if it has the concept of a forward reference. Thus whenever a object reference is required, a
257 'forward forwardReference' can be given instead. What gets serialized is simply an unique forward
258 reference index (index into an array), and at some later time that index is given its true
259 value. This can either happen with the target object is serialized (see
260 Serializer.Tags.ForwardDefintion) or at the end of the serialization in a forward
261 reference table (which allows forward references to be resolved without scanning then entire
264 * Contract between objects IFastSerializable.ToStream:
266 The heart of the serialization and deserialization process the IFastSerializable
267 interface, which implements just two methods: ToStream (for serializing an object), and
268 FromStream (for deserializing and object). This interfaces is the mechanism by which objects
269 tell the serializer what data to store for an individual instance. However this core is not
270 enough. An object that implements IFastSerializable must also implement a default
271 constructor (constructor with no args), so that that deserializer can create the object (and
272 then call FromStream to populated it).
274 The ToStream method is only responsible for serializing the data in the object, and by itself
275 is not sufficient to serialize an interconnected, polymorphic graph of objects. It needs
276 help from the Serializer and Deserialize to do this. Serializer takes on the
277 responsibility to deal with persisting type information (so that Deserialize can create
278 the correct type before IFastSerializable.FromStream is called). It is also the
279 serializer's responsibility to provide the mechanism for dealing with circular object graphs
280 and forward references.
282 * Layout of a serialized object: A serialized object has the following basic format
284 * If the object is the definition of a previous forward references, then the definition must
285 begin with a Serializer.Tags.ForwardDefintion tag followed by a forward forwardReference
286 index which is being defined.
287 * Serializer.Tags.BeginObject tag
288 * A reference to the SerializationType for the object. This reference CANNOT be a
289 forward forwardReference because its value is needed during the deserialization process before
290 forward references are resolved.
291 * All the data that that objects 'IFastSerializable.ToStream method wrote. This is the
292 heart of the deserialized data, and the object itself has a lot of control over this
294 * Serializer.Tags.EndObject tag. This marks the end of the object. It quickly finds bugs
295 in ToStream FromStream mismatches, and also allows for V1 deserializers to skip past
296 additional fields added since V1.
298 * Serializing Object references:
299 When an object forwardReference is serialized, any of the following may follow in the stream
301 * Serializer.Tags.NullReference used to encode a null object forwardReference.
302 * Serializer.Tags.BeginObject or Serializer.Tags.ForwardDefintion, which indicates
303 that this the first time the target object has been referenced, and the target is being
304 serialized on the spot.
305 * Serializer.Tags.ObjectReference which indicates that the target object has already
306 been serialized and what follows is the StreamLabel of where the definition is.
307 * Serializer.Tags.ForwardReference followed by a new forward forwardReference index. This
308 indicates that the object is not yet serialized, but the serializer has chosen not to
309 immediately serialize the object. Ultimately this object will be defined, but has not
313 Types are simply objects of type SerializationType which contain enough information about
314 the type for the Deserializer to do its work (it full name and version number). They are
315 serialized just like all other types. The only thing special about it is that references to
316 types after the BeginObject tag must not be forward references.
319 The structure of the file as a whole is simply a list of objects. The first and last objects in
320 the file are part of the serialization infrastructure.
323 * Signature representing Serializer format
324 * EntryObject (most of the rest of the file)
326 * Type for This object (which is a object of type SerializationType)
328 * Type for SerializationType POSITION1
330 * Type for SerializationType
331 * ObjectReference tag // This is how our recursion ends.
332 * StreamLabel for POSITION1
333 * Version Field for SerializationType
334 * Minimum Version Field for SerializationType
335 * FullName string for SerializationType
337 * Version field for EntryObject's type
338 * Minimum Version field for EntryObject's type
339 * FullName string for EntryObject's type
343 * V2_Field (this should be tagged so that it can be skipped by V1 deserializers.
345 * ForwardReferenceTable pseudo-object
346 * Count of forward references
347 * StreamLabel for forward ref 0
348 * StreamLabel for forward ref 1.
350 * SerializationTrailer pseudo-object
351 * StreamLabel ForwardReferenceTable
352 * StreamLabel to SerializationTrailer
356 <member name="M:FastSerialization.Serializer.#ctor(System.String,FastSerialization.IFastSerializable)">
358 Create a serializer writes 'entryObject' to a file.
361 <member name="M:FastSerialization.Serializer.#ctor(System.IO.Stream,FastSerialization.IFastSerializable)">
363 Create a serializer that writes <paramref name="entryObject"/> to a <see cref="T:System.IO.Stream"/>. The serializer
364 will close the stream when it closes.
367 <member name="M:FastSerialization.Serializer.#ctor(System.IO.Stream,FastSerialization.IFastSerializable,System.Boolean)">
369 Create a serializer that writes <paramref name="entryObject"/> to a <see cref="T:System.IO.Stream"/>. The
370 <paramref name="leaveOpen"/> parameter determines whether the serializer will close the stream when it
374 <member name="M:FastSerialization.Serializer.#ctor(FastSerialization.IStreamWriter,FastSerialization.IFastSerializable)">
376 Create a serializer that writes 'entryObject' another IStreamWriter
379 <member name="M:FastSerialization.Serializer.Write(System.Boolean)">
381 Write a bool to a stream
384 <member name="M:FastSerialization.Serializer.Write(System.Byte)">
386 Write a byte to a stream
389 <member name="M:FastSerialization.Serializer.Write(System.Int16)">
391 Write a short to a stream
394 <member name="M:FastSerialization.Serializer.Write(System.Int32)">
396 Write an int to a stream
399 <member name="M:FastSerialization.Serializer.Write(System.Int64)">
401 Write a long to a stream
404 <member name="M:FastSerialization.Serializer.Write(System.Guid)">
406 Write a Guid to a stream
409 <member name="M:FastSerialization.Serializer.Write(System.String)">
411 Write a string to a stream
414 <member name="M:FastSerialization.Serializer.Write(System.Single)">
416 Write a float to a stream
419 <member name="M:FastSerialization.Serializer.Write(System.Double)">
421 Write a double to a stream
424 <member name="M:FastSerialization.Serializer.Write(FastSerialization.StreamLabel)">
426 Write a StreamLabel (pointer to some other part of the stream whose location is current known) to the stream
429 <member name="M:FastSerialization.Serializer.Write(FastSerialization.ForwardReference)">
431 Write a ForwardReference (pointer to some other part of the stream that whose location is not currently known) to the stream
434 <member name="M:FastSerialization.Serializer.Write(FastSerialization.IFastSerializable)">
436 If the object is potentially aliased (multiple references to it), you should write it with this method.
439 <member name="M:FastSerialization.Serializer.WriteDefered(FastSerialization.IFastSerializable)">
441 To tune working set (or disk seeks), or to make the dump of the format more readable, it is
442 valuable to have control over which of several references to an object will actually cause it to
443 be serialized (by default the first encountered does it).
445 WriteDefered allows you to write just a forwardReference to an object with the expectation that
446 somewhere later in the serialization process the object will be serialized. If no call to
447 WriteObject() occurs, then the object is serialized automatically before the stream is closed
448 (thus dangling references are impossible).
451 <member name="M:FastSerialization.Serializer.WritePrivate(FastSerialization.IFastSerializable)">
453 This is an optimized version of WriteObjectReference that can be used in some cases.
455 If the object is not aliased (it has an 'owner' and only that owner has references to it (which
456 implies its lifetime is strictly less than its owners), then the serialization system does not
457 need to put the object in the 'interning' table. This saves a space (entries in the intern table
458 as well as 'SyncEntry' overhead of creating hash codes for object) as well as time (to create
459 that bookkeeping) for each object that is treated as private (which can add up if because it is
460 common that many objects are private). The private instances are also marked in the serialized
461 format so on reading there is a similar bookkeeping savings.
463 The ultimate bits written by WritePrivateObject are the same as WriteObject.
465 TODO Need a DEBUG mode where we detect if others besides the owner reference the object.
468 <member name="M:FastSerialization.Serializer.GetForwardReference">
470 Create a ForwardReference. At some point before the end of the serialization, DefineForwardReference must be called on this value
474 <member name="M:FastSerialization.Serializer.DefineForwardReference(FastSerialization.ForwardReference)">
476 Define the ForwardReference forwardReference to point at the current write location.
478 <param name="forwardReference"></param>
480 <member name="M:FastSerialization.Serializer.WriteTagged(System.Boolean)">
482 Write a byte preceded by a tag that indicates its a byte. These should be read with the corresponding TryReadTagged operation
485 <member name="M:FastSerialization.Serializer.WriteTagged(System.Byte)">
487 Write a byte preceded by a tag that indicates its a byte. These should be read with the corresponding TryReadTagged operation
490 <member name="M:FastSerialization.Serializer.WriteTagged(System.Int16)">
492 Write a byte preceded by a tag that indicates its a short. These should be read with the corresponding TryReadTagged operation
495 <member name="M:FastSerialization.Serializer.WriteTagged(System.Int32)">
497 Write a byte preceded by a tag that indicates its a int. These should be read with the corresponding TryReadTagged operation
500 <member name="M:FastSerialization.Serializer.WriteTagged(System.Int64)">
502 Write a byte preceded by a tag that indicates its a long. These should be read with the corresponding TryReadTagged operation
505 <member name="M:FastSerialization.Serializer.WriteTagged(System.String)">
507 Write a byte preceded by a tag that indicates its a string. These should be read with the corresponding TryReadTagged operation
510 <member name="M:FastSerialization.Serializer.WriteTagged(FastSerialization.IFastSerializable)">
512 Write a byte preceded by a tag that indicates its a object. These should be read with the corresponding TryReadTagged operation
515 <member name="M:FastSerialization.Serializer.WriteTaggedBlobHeader(System.Int32)">
517 Writes the header for a skipping an arbitrary blob. THus it writes a Blob
518 tag and the size, and the caller must then write 'sizes' bytes of data in
519 some way. This allows you to create regions of arbitrary size that can
520 be skipped by old as well as new parsers.
522 <param name="size"></param>
524 <member name="M:FastSerialization.Serializer.WriteTaggedEnd">
526 Writes an end tag (which is different from all others). This is useful
527 when you have a deferred region of tagged items.
530 <member name="P:FastSerialization.Serializer.Writer">
532 Retrieve the underlying stream we are writing to. Generally the Write* methods are enough.
535 <member name="M:FastSerialization.Serializer.Close">
537 Completes the writing of the stream.
540 <member name="M:FastSerialization.Serializer.Log(System.String)">
542 To help debug any serialization issues, you can write data to a side file called 'log.serialize.xml'
543 which can track exactly what serialization operations occurred.
546 <member name="M:FastSerialization.Serializer.Dispose">
551 <member name="T:FastSerialization.Deserializer">
553 Deserializer is a helper class that holds all the information needed to deserialize an object
554 graph as a whole (things like the table of objects already deserialized, and the list of types in
557 see #SerializerIntroduction for more
560 <member name="M:FastSerialization.Deserializer.#ctor(System.String)">
562 Create a Deserializer that reads its data from a given file
565 <member name="M:FastSerialization.Deserializer.#ctor(System.IO.Stream,System.String)">
567 Create a Deserializer that reads its data from a given System.IO.Stream. The stream will be closed when the Deserializer is done with it.
570 <member name="M:FastSerialization.Deserializer.#ctor(System.IO.Stream,System.String,System.Boolean)">
572 Create a Deserializer that reads its data from a given System.IO.Stream. The
573 <paramref name="leaveOpen"/> parameter determines whether the deserializer will close the stream when it
577 <member name="M:FastSerialization.Deserializer.#ctor(FastSerialization.IStreamReader,System.String)">
579 Create a Deserializer that reads its data from a given IStreamReader. The stream will be closed when the Deserializer is done with it.
582 <member name="M:FastSerialization.Deserializer.GetEntryTypeName">
584 Returns the full name of the type of the entry object without actually creating it.
585 Will return null on failure.
588 <member name="M:FastSerialization.Deserializer.GetEntryObject``1(``0@)">
590 GetEntryObject is the main deserialization entry point. The serialization stream always has an object that represents the stream as
591 a whole, called the entry object and this returns it and places it in 'ret'
594 <member name="M:FastSerialization.Deserializer.GetEntryObject">
596 GetEntryObject is the main deserialization entry point. The serialization stream always has an object that represents the stream as
597 a whole, called the entry object and this returns it and returns it
600 <member name="M:FastSerialization.Deserializer.Read(System.Boolean@)">
602 Read a bool from the stream
605 <member name="M:FastSerialization.Deserializer.Read(System.Byte@)">
607 Read a byte from the stream
610 <member name="M:FastSerialization.Deserializer.Read(System.Int16@)">
612 Read a short from the stream
615 <member name="M:FastSerialization.Deserializer.Read(System.Int32@)">
617 Read an int from the stream
620 <member name="M:FastSerialization.Deserializer.Read(System.Int64@)">
622 Read a long from the stream
625 <member name="M:FastSerialization.Deserializer.Read(System.Guid@)">
627 Read a Guid from the stream
630 <member name="M:FastSerialization.Deserializer.Read(System.Single@)">
632 Read a float from the stream
635 <member name="M:FastSerialization.Deserializer.Read(System.Double@)">
637 Read a double from the stream
640 <member name="M:FastSerialization.Deserializer.Read(System.String@)">
642 Read a string from the stream. Can represent null
645 <member name="M:FastSerialization.Deserializer.Read(FastSerialization.StreamLabel@)">
650 <member name="M:FastSerialization.Deserializer.Read``1(``0@)">
652 Read a IFastSerializable object from the stream and place it in ret
655 <member name="M:FastSerialization.Deserializer.ReadObject">
657 Read a IFastSerializable object from the stream and return it
660 <member name="M:FastSerialization.Deserializer.ReadBool">
662 Read a bool from the stream and return it
665 <member name="M:FastSerialization.Deserializer.ReadByte">
667 Read a byte from the stream and return it
670 <member name="M:FastSerialization.Deserializer.ReadInt16">
672 Read a short from the stream and return it
675 <member name="M:FastSerialization.Deserializer.ReadInt">
677 Read an int from the stream and return it
680 <member name="M:FastSerialization.Deserializer.ReadInt64">
682 Read a long from the stream and return it
685 <member name="M:FastSerialization.Deserializer.ReadFloat">
687 Read a float from the stream and return it
690 <member name="M:FastSerialization.Deserializer.ReadDouble">
692 Read a double from the stream and return it
695 <member name="M:FastSerialization.Deserializer.ReadString">
697 Read in a string value and return it
700 <member name="M:FastSerialization.Deserializer.ReadLabel">
702 Read in a StreamLabel (a pointer to some other part of the stream) and return it
705 <member name="M:FastSerialization.Deserializer.ReadForwardReference">
707 Read in a ForwardReference (a pointer to some other part of the stream which was not known at the tie it was written) and return it
708 Use ResolveForwardReference to convert the ForwardReference to a StreamLabel
711 <member name="M:FastSerialization.Deserializer.ResolveForwardReference(FastSerialization.ForwardReference,System.Boolean)">
713 Given a forward reference find the StreamLabel (location in the stream) that it points at).
714 Normally this call preserves the current read location, but if you do don't care you can
715 set preserveCurrent as an optimization to make it more efficient.
718 <member name="P:FastSerialization.Deserializer.VersionBeingRead">
720 Meant to be called from FromStream. It returns the version number of the
721 type being deserialized. It can be used so that new code can recognizes that it
722 is reading an old file format and adjust what it reads.
725 <member name="P:FastSerialization.Deserializer.MinimumReaderVersionBeingRead">
727 Meant to be called from FromStream. It returns the version number of the MinimumReaderVersion
728 of the type that was serialized.
731 <member name="P:FastSerialization.Deserializer.Name">
733 The filename if read from a file or the stream name if read from a stream
736 <member name="P:FastSerialization.Deserializer.TypeResolver">
738 If set this function is set, then it is called whenever a type name from the serialization
739 data is encountered. It is your you then need to look that up. If it is not present
740 it uses Type.GetType(string) which only checks the current assembly and mscorlib.
743 <member name="M:FastSerialization.Deserializer.RegisterFactory(System.Type,System.Func{FastSerialization.IFastSerializable})">
745 For every IFastSerializable object being deserialized, the Deserializer needs to create 'empty' objects
746 that 'FromStream' is invoked on. The Deserializer gets these 'empty' objects by calling a 'factory'
747 delegate for that type. Thus all types being deserialized must have a factory.
749 RegisterFactory registers such a factory for particular 'type'.
752 <member name="M:FastSerialization.Deserializer.RegisterDefaultFactory(System.Func{System.Type,FastSerialization.IFastSerializable})">
754 For every IFastSerializable object being deserialized, the Deserializer needs to create 'empty' objects
755 that 'FromStream' is invoked on. The Deserializer gets these 'empty' objects by calling a 'factory'
756 delegate for that type. Thus all types being deserialized must have a factory.
758 RegisterDefaultFactory registers a factory that is passed a type parameter and returns a new IFastSerialable object.
761 <member name="M:FastSerialization.Deserializer.TryReadTagged(System.Boolean@)">
763 Try to read tagged value from the stream. If it is a tagged bool, return int in ret and return true, otherwise leave the cursor unchanged and return false
766 <member name="M:FastSerialization.Deserializer.TryReadTagged(System.Byte@)">
768 Try to read tagged value from the stream. If it is a tagged byte, return int in ret and return true, otherwise leave the cursor unchanged and return false
771 <member name="M:FastSerialization.Deserializer.TryReadTagged(System.Int16@)">
773 Try to read tagged value from the stream. If it is a tagged short, return int in ret and return true, otherwise leave the cursor unchanged and return false
776 <member name="M:FastSerialization.Deserializer.TryReadTagged(System.Int32@)">
778 Try to read tagged value from the stream. If it is a tagged int, return int in ret and return true, otherwise leave the cursor unchanged and return false
781 <member name="M:FastSerialization.Deserializer.TryReadTagged(System.Int64@)">
783 Try to read tagged value from the stream. If it is a tagged long, return int in ret and return true, otherwise leave the cursor unchanged and return false
786 <member name="M:FastSerialization.Deserializer.TryReadTagged(System.String@)">
788 Try to read tagged value from the stream. If it is a tagged string, return int in ret and return true, otherwise leave the cursor unchanged and return false
791 <member name="M:FastSerialization.Deserializer.TryReadTaggedBlobHeader">
793 Try to read the header for a tagged blob of bytes. If Current points at a tagged
794 blob it succeeds and returns the size of the blob (the caller must read or skip
795 past it manually) If it is not a tagged blob it returns a size of 0 and resets
796 the read pointer to what it was before this method was called.
799 <member name="M:FastSerialization.Deserializer.TryReadTagged``1(``0@)">
801 Try to read tagged value from the stream. If it is a tagged FastSerializable, return int in ret and return true, otherwise leave the cursor unchanged and return false
804 <member name="M:FastSerialization.Deserializer.TryReadTaggedObject">
806 Try to read tagged value from the stream. If it is a tagged FastSerializable, return it, otherwise leave the cursor unchanged and return null
809 <member name="M:FastSerialization.Deserializer.Goto(FastSerialization.StreamLabel)">
811 Set the read position to the given StreamLabel
814 <member name="M:FastSerialization.Deserializer.Goto(FastSerialization.ForwardReference)">
816 Set the read position to the given ForwardReference
819 <member name="P:FastSerialization.Deserializer.Current">
821 Returns the current read position in the stream.
824 <member name="P:FastSerialization.Deserializer.Reader">
826 Fetch the underlying IStreamReader that the deserializer reads data from
829 <member name="M:FastSerialization.Deserializer.Dispose">
831 Close the IStreamReader and free resources associated with the Deserializer
834 <member name="F:FastSerialization.Deserializer.deferForwardReferences">
836 When we encounter a forward reference, we can either go to the forward reference table immediately and resolve it
837 (deferForwardReferences == false), or simply remember that that position needs to be fixed up and continue with
838 the deserialization. This later approach allows 'no seek' deserialization. This variable which scheme we do.
841 <member name="T:FastSerialization.DeferedRegion">
843 #DeferedRegionOverview.
845 A DeferedRegion help make 'lazy' objects. You will have a DeferedRegion for each block of object you
846 wish to independently decide whether to deserialize lazily (typically you have one per object however
847 in the limit you can have one per field, it is up to you).
849 When you call DeferedRegion.Write you give it a delegate that will write all the deferred fields.
850 The Write operation will place a forward reference in the stream that skips all the fields written,
851 then the fields themselves, then define the forward reference. This allows readers to skip the
854 When you call DeferedRegion.Read you also give it a delegate that reads all the deferred fields.
855 However when 'Read' instead of reading the fields it
857 * remembers the deserializer, stream position, and reading delegate.
858 * it uses the forward reference to skip the region.
860 When DeferedRegion.FinishRead is called, it first checks if the region was already restored.
861 If not it used the information to read in the deferred region and returns. Thus this FinishRead
862 should be called before any deferred field is used.
865 <member name="M:FastSerialization.DeferedRegion.Write(FastSerialization.Serializer,System.Action)">
867 see #DeferedRegionOverview.
871 <member name="M:FastSerialization.DeferedRegion.Read(FastSerialization.Deserializer,System.Action)">
873 See overview in DeferedRegion class comment.
874 This call indicates that the 'fromStream' delegate can deserialize a region of the object, which
875 was serialized with the DeferedRegion.Write method. The read skips the data for the region (thus
876 no objects associated with the region are created in memory) but the deferred object remembers
877 'fromStream' and will call it when 'FinishRead()' is called.
880 <member name="M:FastSerialization.DeferedRegion.FinishRead(System.Boolean)">
882 FinishRead indicates that you need to deserialize the lazy region you defined with the 'Read' method.
883 If the region has already been deserialized, nothing is done. Otherwise when you call this
884 method the current position in the stream is put back to where it was when Read was called and the
885 'fromStream' delegate registered in 'Read' is called to perform the deserialization.
888 <member name="P:FastSerialization.DeferedRegion.IsFinished">
890 Returns true if the FinsihRead() has already been called.
893 <member name="P:FastSerialization.DeferedRegion.Deserializer">
895 Get the deserializer assoicated with this DeferredRegion
898 <member name="P:FastSerialization.DeferedRegion.StartPosition">
900 Get the stream position when Read was called
903 <member name="M:FastSerialization.DeferedRegion.FinishReadHelper(System.Boolean)">
905 This helper is just here to insure that FinishRead gets inlined
908 <member name="T:FastSerialization.IFastSerializable">
910 A type can opt into being serializable by implementing IFastSerializable and a default constructor
911 (constructor that takes not arguments).
913 Conceptually all clients of IFastSerializable also implement IFastSerializableVersion
914 however the serializer will assume a default implementation of IFastSerializableVersion (that
915 Returns version 1 and assumes all versions are allowed to deserialize it.
918 <member name="M:FastSerialization.IFastSerializable.ToStream(FastSerialization.Serializer)">
920 Given a Serializer, write yourself to the output stream. Conceptually this routine is NOT
921 responsible for serializing its type information but only its field values. However it is
922 conceptually responsible for the full transitive closure of its fields.
924 * For primitive fields, the choice is easy, simply call Serializer.Write
925 * For object fields there is a choice
926 * If is is only references by the enclosing object (eg and therefore field's lifetime is
927 identical to referencing object), then the Serialize.WritePrivateObject can be
928 used. This skips placing the object in the interning table (that insures it is written
930 * Otherwise call Serialize.WriteObject
931 * For value type fields (or collections of structs), you serialize the component fields.
932 * For collections, typically you serialize an integer inclusiveCountRet followed by each object.
935 <member name="M:FastSerialization.IFastSerializable.FromStream(FastSerialization.Deserializer)">
938 Given a reader, and a 'this' instance, made by calling the default constructor, create a fully
939 initialized instance of the object from the reader stream. The deserializer provides the extra
940 state needed to do this for cyclic object graphs.
942 Note that it is legal for the instance to cache the deserializer and thus be 'lazy' about when
943 the actual deserialization happens (thus large persisted strucuture on the disk might stay on the
946 Typically the FromStream implementation is an exact mirror of the ToStream implementation, where
947 there is a Read() for every Write().
950 <member name="T:FastSerialization.IFastSerializableVersion">
952 Objects implement IFastSerializableVersion to indicate what the current version is for writing
953 and which readers can read the current version. If this interface is not implemented a default is
954 provided (assuming version 1 for writing and MinimumVersion = 0).
956 By default Serializer.WriteObject will place marks when the object ends and always skip to the
957 end even if the FromStream did not read all the object data. This allows considerable versioning
958 flexibility. Simply by placing the new data at the end of the existing serialization, new versions
959 of the type can be read by OLD deserializers (new fields will have the value determined by the
960 default constructor (typically 0 or null). This makes is relatively easy to keep MinimumVersion = 0
964 <member name="P:FastSerialization.IFastSerializableVersion.Version">
966 This is the version number for the serialization CODE (that is the app decoding the format)
967 It should be incremented whenever a change is made to IFastSerializable.ToStream and the format
968 is publicly disseminated. It must not vary from instance to instance. This is pretty straightforward.
972 <member name="P:FastSerialization.IFastSerializableVersion.MinimumVersionCanRead">
974 At some point typically you give up allowing new versions of the read to read old wire formats
975 This is the Minimum version of the serialized data that this reader can deserialize. Trying
976 to read wire formats strictly smaller (older) than this will fail. Setting this to the current
977 version indicates that you don't care about ever reading data generated with an older version
980 If you set this to something other than your current version, you are obligated to insure that
981 your FromStream() method can handle all formats >= than this number.
983 You can achieve this if you simply use the 'WriteTagged' and 'ReadTagged' APIs in your 'ToStream'
984 and 'FromStream' after your V1 AND you always add new fields to the end of your class.
985 This is the best practice. Thus
987 void IFastSerializable.ToStream(Serializer serializer)
989 serializer.Write(Ver_1_Field1);
990 serializer.Write(Ver_1_Field2);
992 serializer.WriteTagged(Ver_2_Field1);
993 serializer.WriteTagged(Ver_2_Field2);
995 serializer.WriteTagged(Ver_3_Field1);
998 void IFastSerializable.FromStream(Deserializer deserializer)
1000 deserializer.Read(out Ver_1_Field1);
1001 deserializer.Read(out Ver_1_Field2);
1003 deserializer.TryReadTagged(ref Ver_2_Field1); // If data no present (old format) then Ver_2_Field1 not set.
1004 deserializer.TryReadTagged(ref Ver_2_Field2); // ditto...
1006 deserializer.TryReadTagged(ref Ver_3_Field1);
1009 Tagging outputs a byte tag in addition to the field itself. If that is a problem you can also use the
1010 VersionBeingRead to find out what format is being read and write code that explicitly handles it.
1011 Note however that this only gets you Backward compatibility (new readers can read the old format, but old readers
1012 will still not be able to read the new format), which is why this is not the preferred method.
1014 void IFastSerializable.FromStream(Deserializer deserializer)
1016 // We assume that MinVersionCanRead == 4
1017 // Deserialize things that are common to all versions (4 and earlier)
1019 if (deserializer.VersionBeingRead >= 5)
1021 deserializer.Read(AVersion5Field);
1022 if (deserializer.VersionBeingRead >= 5)
1023 deserializer.ReadTagged(AVersion6Field);
1028 <member name="P:FastSerialization.IFastSerializableVersion.MinimumReaderVersion">
1030 This is the minimum version of a READER that can read this format. If you don't support forward
1031 compatibility (old readers reading data generated by new readers) then this should be set to
1032 the current version.
1034 If you set this to something besides the current version you are obligated to insure that your
1035 ToStream() method ONLY adds fields at the end, AND that all of those added fields use the WriteTagged()
1036 operations (which tags the data in a way that old readers can skip even if they don't know what it is)
1037 In addition your FromStream() method must read these with the ReadTagged() deserializer APIs.
1039 See the comment in front of MinimumVersionCanRead for an example of using the WriteTagged() and ReadTagged()
1043 <member name="T:FastSerialization.SerializationException">
1045 Thrown when the deserializer detects an error.
1048 <member name="M:FastSerialization.SerializationException.#ctor(System.String)">
1050 Thown when a error occurs in serialization.
1053 <member name="P:FastSerialization.SerializationType.Version">
1055 This is the version represents the version of both the reading
1056 code and the version for the format for this type in serialized form.
1057 See IFastSerializableVersion for more.
1060 <member name="P:FastSerialization.SerializationType.MinimumReaderVersion">
1062 The version the the smallest (oldest) reader code that can read
1063 this file format. Readers strictly less than this are rejected.
1064 This allows support for forward compatbility.
1065 See IFastSerializableVersion for more.
1068 <member name="M:FastSerialization.SegmentedMemoryStreamReader.#ctor(System.Collections.Generic.SegmentedList{System.Byte})">
1070 Create a IStreamReader (reads binary data) from a given byte buffer
1073 <member name="M:FastSerialization.SegmentedMemoryStreamReader.#ctor(System.Collections.Generic.SegmentedList{System.Byte},System.Int32,System.Int32)">
1075 Create a IStreamReader (reads binary data) from a given subregion of a byte buffer
1078 <member name="P:FastSerialization.SegmentedMemoryStreamReader.Length">
1080 The total length of bytes that this reader can read.
1083 <member name="M:FastSerialization.SegmentedMemoryStreamReader.ReadByte">
1085 Implementation of IStreamReader
1088 <member name="M:FastSerialization.SegmentedMemoryStreamReader.ReadInt16">
1090 Implementation of IStreamReader
1093 <member name="M:FastSerialization.SegmentedMemoryStreamReader.ReadInt32">
1095 Implementation of IStreamReader
1098 <member name="M:FastSerialization.SegmentedMemoryStreamReader.ReadInt64">
1100 Implementation of IStreamReader
1103 <member name="M:FastSerialization.SegmentedMemoryStreamReader.ReadString">
1105 Implementation of IStreamReader
1108 <member name="M:FastSerialization.SegmentedMemoryStreamReader.ReadLabel">
1110 Implementation of IStreamReader
1113 <member name="M:FastSerialization.SegmentedMemoryStreamReader.Goto(FastSerialization.StreamLabel)">
1115 Implementation of IStreamReader
1118 <member name="P:FastSerialization.SegmentedMemoryStreamReader.Current">
1120 Implementation of IStreamReader
1123 <member name="M:FastSerialization.SegmentedMemoryStreamReader.GotoSuffixLabel">
1125 Implementation of IStreamReader
1128 <member name="M:FastSerialization.SegmentedMemoryStreamReader.Dispose">
1133 <member name="M:FastSerialization.SegmentedMemoryStreamReader.Dispose(System.Boolean)">
1138 <member name="T:FastSerialization.MemoryStreamReader">
1140 A MemoryStreamReader is an implementation of the IStreamReader interface that works over a given byte[] array.
1143 <member name="M:FastSerialization.MemoryStreamReader.#ctor(System.Byte[])">
1145 Create a IStreamReader (reads binary data) from a given byte buffer
1148 <member name="M:FastSerialization.MemoryStreamReader.#ctor(System.Byte[],System.Int32,System.Int32)">
1150 Create a IStreamReader (reads binary data) from a given subregion of a byte buffer
1153 <member name="P:FastSerialization.MemoryStreamReader.Length">
1155 The total length of bytes that this reader can read.
1158 <member name="M:FastSerialization.MemoryStreamReader.ReadByte">
1160 Implementation of IStreamReader
1163 <member name="M:FastSerialization.MemoryStreamReader.ReadInt16">
1165 Implementation of IStreamReader
1168 <member name="M:FastSerialization.MemoryStreamReader.ReadInt32">
1170 Implementation of IStreamReader
1173 <member name="M:FastSerialization.MemoryStreamReader.ReadInt64">
1175 Implementation of IStreamReader
1178 <member name="M:FastSerialization.MemoryStreamReader.ReadString">
1180 Implementation of IStreamReader
1183 <member name="M:FastSerialization.MemoryStreamReader.ReadLabel">
1185 Implementation of IStreamReader
1188 <member name="M:FastSerialization.MemoryStreamReader.Goto(FastSerialization.StreamLabel)">
1190 Implementation of IStreamReader
1193 <member name="P:FastSerialization.MemoryStreamReader.Current">
1195 Implementation of IStreamReader
1198 <member name="M:FastSerialization.MemoryStreamReader.GotoSuffixLabel">
1200 Implementation of IStreamReader
1203 <member name="M:FastSerialization.MemoryStreamReader.Dispose">
1208 <member name="M:FastSerialization.MemoryStreamReader.Dispose(System.Boolean)">
1213 <member name="T:FastSerialization.MemoryStreamWriter">
1215 A StreamWriter is an implementation of the IStreamWriter interface that generates a byte[] array.
1218 <member name="M:FastSerialization.MemoryStreamWriter.#ctor(System.Int32)">
1220 Create IStreamWriter that writes its data to an internal byte[] buffer. It will grow as needed.
1221 Call 'GetReader' to get a IStreamReader for the written bytes.
1223 Call 'GetBytes' call to get the raw array. Only the first 'Length' bytes are valid
1226 <member name="M:FastSerialization.MemoryStreamWriter.GetReader">
1228 Returns a IStreamReader that will read the written bytes. You cannot write additional bytes to the stream after making this call.
1232 <member name="P:FastSerialization.MemoryStreamWriter.Length">
1234 The number of bytes written so far.
1237 <member name="M:FastSerialization.MemoryStreamWriter.GetBytes">
1239 The array that holds the serialized data.
1243 <member name="M:FastSerialization.MemoryStreamWriter.Clear">
1245 Clears any data that was previously written.
1248 <member name="M:FastSerialization.MemoryStreamWriter.Write(System.Byte)">
1250 Implementation of IStreamWriter
1253 <member name="M:FastSerialization.MemoryStreamWriter.Write(System.Int16)">
1255 Implementation of IStreamWriter
1258 <member name="M:FastSerialization.MemoryStreamWriter.Write(System.Int32)">
1260 Implementation of IStreamWriter
1263 <member name="M:FastSerialization.MemoryStreamWriter.Write(System.Int64)">
1265 Implementation of IStreamWriter
1268 <member name="M:FastSerialization.MemoryStreamWriter.Write(FastSerialization.StreamLabel)">
1270 Implementation of IStreamWriter
1273 <member name="M:FastSerialization.MemoryStreamWriter.Write(System.String)">
1275 Implementation of IStreamWriter
1278 <member name="M:FastSerialization.MemoryStreamWriter.GetLabel">
1280 Implementation of IStreamWriter
1283 <member name="M:FastSerialization.MemoryStreamWriter.WriteSuffixLabel(FastSerialization.StreamLabel)">
1285 Implementation of IStreamWriter
1288 <member name="M:FastSerialization.MemoryStreamWriter.Dispose">
1293 <member name="M:FastSerialization.MemoryStreamWriter.Dispose(System.Boolean)">
1298 <member name="M:FastSerialization.MemoryStreamWriter.MakeSpace">
1300 Makespace makes at least sizeof(long) bytes available (or throws OutOfMemory)
1303 <member name="T:FastSerialization.IOStreamStreamReader">
1305 A IOStreamStreamReader hooks a MemoryStreamReader up to an input System.IO.Stream.
1308 <member name="M:FastSerialization.IOStreamStreamReader.#ctor(System.String)">
1310 Create a new IOStreamStreamReader from the given file.
1312 <param name="fileName"></param>
1314 <member name="M:FastSerialization.IOStreamStreamReader.#ctor(System.IO.Stream,System.Int32,System.Boolean)">
1316 Create a new IOStreamStreamReader from the given System.IO.Stream. Optionally you can specify the size of the read buffer
1317 The stream will be closed by the IOStreamStreamReader when it is closed.
1320 <member name="M:FastSerialization.IOStreamStreamReader.Close">
1322 close the file or underlying stream and clean up
1325 <member name="P:FastSerialization.IOStreamStreamReader.Current">
1327 Implementation of IStreamReader
1330 <member name="M:FastSerialization.IOStreamStreamReader.Goto(FastSerialization.StreamLabel)">
1332 Implementation of IStreamReader
1335 <member name="P:FastSerialization.IOStreamStreamReader.Length">
1337 Implementation of MemoryStreamReader
1340 <member name="M:FastSerialization.IOStreamStreamReader.Dispose(System.Boolean)">
1345 <member name="M:FastSerialization.IOStreamStreamReader.Fill(System.Int32)">
1347 Fill the buffer, making sure at least 'minimum' byte are available to read. Throw an exception
1348 if there are not that many bytes.
1350 <param name="minimum"></param>
1352 <member name="T:FastSerialization.PinnedStreamReader">
1354 A PinnedStreamReader is an IOStream reader that will pin its read buffer.
1355 This allows it it support a 'GetPointer' API efficiently. The
1356 GetPointer API lets you access data from the stream as raw byte
1357 blobs without having to copy the data.
1360 <member name="M:FastSerialization.PinnedStreamReader.#ctor(System.String,System.Int32)">
1362 Create a new PinnedStreamReader that gets its data from a given file. You can optionally set the size of the read buffer.
1365 <member name="M:FastSerialization.PinnedStreamReader.#ctor(System.IO.Stream,System.Int32)">
1367 Create a new PinnedStreamReader that gets its data from a given System.IO.Stream. You can optionally set the size of the read buffer.
1368 The stream will be closed by the PinnedStreamReader when it is closed.
1371 <member name="M:FastSerialization.PinnedStreamReader.Clone">
1373 Clone the PinnnedStreamReader so that it reads from the same stream as this one. They will share the same
1374 System.IO.Stream, but each will lock and seek when accessing that stream so they can both safely share it.
1378 <member name="M:FastSerialization.PinnedStreamReader.GetPointer(FastSerialization.StreamLabel,System.Int32)">
1380 Get a byte* pointer to the input buffer at 'Position' in the IReadStream that is at least 'length' bytes long.
1381 (thus ptr to ptr+len is valid). Note that length cannot be larger than the buffer size passed to the reader
1382 when it was constructed.
1385 <member name="M:FastSerialization.PinnedStreamReader.GetPointer(System.Int32)">
1387 Get a byte* pointer to the input buffer at the current read position is at least 'length' bytes long.
1388 (thus ptr to ptr+len is valid). Note that length cannot be larger than the buffer size passed to the reader
1389 when it was constructed.
1392 <member name="T:FastSerialization.IOStreamStreamWriter">
1394 A IOStreamStreamWriter hooks a MemoryStreamWriter up to an output System.IO.Stream
1397 <member name="M:FastSerialization.IOStreamStreamWriter.#ctor(System.String)">
1399 Create a IOStreamStreamWriter that writes its data to a given file that it creates
1401 <param name="fileName"></param>
1403 <member name="M:FastSerialization.IOStreamStreamWriter.#ctor(System.IO.Stream,System.Int32,System.Boolean)">
1405 Create a IOStreamStreamWriter that writes its data to a System.IO.Stream
1408 <member name="M:FastSerialization.IOStreamStreamWriter.Flush">
1410 Flush any written data to the underlying System.IO.Stream
1413 <member name="M:FastSerialization.IOStreamStreamWriter.Close">
1415 Insures the bytes in the stream are written to the stream and cleans up resources.
1418 <member name="P:FastSerialization.IOStreamStreamWriter.RawStream">
1420 Access the underlying System.IO.Stream. You should avoid using this if at all possible.
1423 <member name="P:FastSerialization.IOStreamStreamWriter.Length">
1425 Implementation of the MemoryStreamWriter interface
1428 <member name="M:FastSerialization.IOStreamStreamWriter.GetLabel">
1430 Implementation of the IStreamWriter interface
1433 <member name="M:FastSerialization.IOStreamStreamWriter.Clear">
1435 Implementation of the MemoryStreamWriter interface
1438 <member name="M:FastSerialization.IOStreamStreamWriter.GetReader">
1440 Implementation of the MemoryStreamWriter interface
1443 <member name="M:FastSerialization.IOStreamStreamWriter.GetBytes">
1445 Implementation of the MemoryStreamWriter interface
1448 <member name="M:FastSerialization.IOStreamStreamWriter.Dispose(System.Boolean)">
1453 <member name="T:System.Collections.Generic.GrowableArray`1">
1455 A cheap version of List(T). The idea is to make it as cheap as if you did it 'by hand' using an array and
1456 an int which represents the logical charCount. It is a struct to avoid an extra pointer dereference, so this
1457 is really meant to be embedded in other structures.
1460 <member name="M:System.Collections.Generic.GrowableArray`1.#ctor(System.Int32)">
1462 Create a growable array with the given initial size it will grow as needed. There is also the
1463 default constructor that assumes initialSize of 0 (and does not actually allocate the array.
1465 <param name="initialSize"></param>
1467 <member name="P:System.Collections.Generic.GrowableArray`1.Item(System.Int32)">
1469 Fetch the element at the given index. Will throw an IndexOutOfRange exception otherwise
1472 <member name="P:System.Collections.Generic.GrowableArray`1.Count">
1474 The number of elements in the array
1477 <member name="M:System.Collections.Generic.GrowableArray`1.Clear">
1479 Remove all elements in the array.
1482 <member name="M:System.Collections.Generic.GrowableArray`1.Add(`0)">
1484 Add an item at the end of the array, growing as necessary.
1486 <param name="item"></param>
1488 <member name="M:System.Collections.Generic.GrowableArray`1.AddRange(System.Collections.Generic.IEnumerable{`0})">
1490 Add all items 'items' to the end of the array, growing as necessary.
1492 <param name="items"></param>
1494 <member name="M:System.Collections.Generic.GrowableArray`1.Insert(System.Int32,`0)">
1496 Insert 'item' directly at 'index', shifting all items >= index up. 'index' can be code:Count in
1497 which case the item is appended to the end. Larger indexes are not allowed.
1500 <member name="M:System.Collections.Generic.GrowableArray`1.RemoveRange(System.Int32,System.Int32)">
1502 Remove 'count' elements starting at 'index'
1505 <member name="M:System.Collections.Generic.GrowableArray`1.Set(System.Int32,`0)">
1507 Sets the 'index' element to 'value' growing the array if necessary (filling in default values if necessary).
1510 <member name="M:System.Collections.Generic.GrowableArray`1.Get(System.Int32)">
1512 Gets the value at 'index'. Never fails, will return 'default' if out of range.
1515 <member name="P:System.Collections.Generic.GrowableArray`1.Empty">
1517 Returns true if there are no elements in the array.
1520 <member name="M:System.Collections.Generic.GrowableArray`1.Pop">
1522 Remove the last element added and return it. Will throw if there are no elements.
1526 <member name="P:System.Collections.Generic.GrowableArray`1.Top">
1528 Returns the last element added Will throw if there are no elements.
1531 <member name="M:System.Collections.Generic.GrowableArray`1.Trim(System.Int32)">
1533 Trims the size of the array so that no more than 'maxWaste' slots are wasted. Useful when
1534 you know that the array has stopped growing.
1537 <member name="P:System.Collections.Generic.GrowableArray`1.EmptyCapacity">
1539 Returns true if the Growable array was initialized by the default constructor
1540 which has no capacity (and thus will cause growth on the first addition).
1541 This method allows you to lazily set the compacity of your GrowableArray by
1542 testing if it is of EmtpyCapacity, and if so set it to some useful capacity.
1543 This avoids unecessary reallocs to get to a reasonable capacity.
1546 <member name="M:System.Collections.Generic.GrowableArray`1.ToString">
1548 A string representing the array. Only intended for debugging.
1552 <member name="M:System.Collections.Generic.GrowableArray`1.BinarySearch``1(``0,System.Int32@,System.Func{``0,`0,System.Int32})">
1554 Sets 'index' to the the smallest index such that all elements with index > 'idx' are > key. If
1555 index does not match any elements a new element should always be placed AFTER index. Note that this
1556 means that index may be -1 if the new element belongs in the first position.
1558 Returns true if the return index matched exactly (success)
1560 TODO FIX NOW harmonize with List.BinarySearch
1563 <member name="M:System.Collections.Generic.GrowableArray`1.Sort(System.Int32,System.Int32,System.Comparison{`0})">
1565 Sort the range starting at 'index' of length 'count' using 'comparision' in assending order
1568 <member name="M:System.Collections.Generic.GrowableArray`1.Sort(System.Comparison{`0})">
1570 Sort the whole array using 'comparison' in ascending order
1573 <member name="M:System.Collections.Generic.GrowableArray`1.Foreach``1(System.Func{`0,``0})">
1575 Executes 'func' for each element in the GrowableArray and returns a GrowableArray
1579 <member name="M:System.Collections.Generic.GrowableArray`1.Search``1(``0,System.Int32,System.Func{``0,`0,System.Int32},System.Int32@)">
1581 Perform a linear search starting at 'startIndex'. If found return true and the index in 'index'.
1582 It is legal that 'startIndex' is greater than the charCount, in which case, the search returns false
1583 immediately. This allows a nice loop to find all items matching a pattern.
1586 <member name="P:System.Collections.Generic.GrowableArray`1.UnderlyingArray">
1588 Returns the underlying array. Should not be used most of the time!
1591 <member name="M:System.Collections.Generic.GrowableArray`1.GetEnumerator">
1593 Implementation of foreach protocol
1597 <member name="T:System.Collections.Generic.GrowableArray`1.GrowableArrayEnumerator">
1599 Enumerator for foreach interface
1602 <member name="P:System.Collections.Generic.GrowableArray`1.GrowableArrayEnumerator.Current">
1604 implementation of IEnumerable interface
1607 <member name="M:System.Collections.Generic.GrowableArray`1.GrowableArrayEnumerator.MoveNext">
1609 implementation of IEnumerable interface
1612 <member name="T:System.Collections.Generic.SegmentedList`1">
1614 Segmented list implementation, copied from Microsoft.Exchange.Collections.
1616 <typeparam name="T">The type of the list element.</typeparam>
1618 This class implement a list which is allocated in segments, to avoid large lists to go into LOH.
1621 <member name="M:System.Collections.Generic.SegmentedList`1.#ctor(System.Int32)">
1623 Constructs SegmentedList.
1625 <param name="segmentSize">Segment size</param>
1627 <member name="M:System.Collections.Generic.SegmentedList`1.#ctor(System.Int32,System.Int32)">
1629 Constructs SegmentedList.
1631 <param name="segmentSize">Segment size</param>
1632 <param name="initialCapacity">Initial capacity</param>
1634 <member name="P:System.Collections.Generic.SegmentedList`1.Count">
1636 Returns the count of elements in the list.
1639 <member name="P:System.Collections.Generic.SegmentedList`1.UnderlyingArray">
1643 <returns>Array copy</returns>
1645 <member name="M:System.Collections.Generic.SegmentedList`1.Pop">
1647 Returns the last element on the list and removes it from it.
1649 <returns>The last element that was on the list.</returns>
1651 <member name="P:System.Collections.Generic.SegmentedList`1.System#Collections#Generic#ICollection{T}#IsReadOnly">
1653 Returns true if this ICollection is read-only.
1656 <member name="P:System.Collections.Generic.SegmentedList`1.Item(System.Int32)">
1658 Gets or sets the given element in the list.
1660 <param name="index">Element index.</param>
1662 <member name="M:System.Collections.Generic.SegmentedList`1.IsValidIndex(System.Int32)">
1664 Necessary if the list is being used as an array since it creates the segments lazily.
1666 <param name="index"></param>
1667 <returns>true if the segment is allocated and false otherwise</returns>
1669 <member name="M:System.Collections.Generic.SegmentedList`1.GetSlot(System.Int32,System.Int32@)">
1671 Get slot of an element
1673 <param name="index"></param>
1674 <param name="slot"></param>
1677 <member name="M:System.Collections.Generic.SegmentedList`1.Add(`0)">
1679 Adds new element at the end of the list.
1681 <param name="item">New element.</param>
1683 <member name="M:System.Collections.Generic.SegmentedList`1.Insert(System.Int32,`0)">
1685 Inserts new element at the given position in the list.
1687 <param name="index">Insert position.</param>
1688 <param name="item">New element to insert.</param>
1690 <member name="M:System.Collections.Generic.SegmentedList`1.RemoveAt(System.Int32)">
1692 Removes element at the given position in the list.
1694 <param name="index">Position of the element to remove.</param>
1696 <member name="M:System.Collections.Generic.SegmentedList`1.BinarySearch(`0,System.Collections.Generic.IComparer{`0})">
1698 Performs a binary search in a sorted list.
1700 <param name="item">Element to search for.</param>
1701 <param name="comparer">Comparer to use.</param>
1702 <returns>Non-negative position of the element if found, negative binary complement of the position of the next element if not found.</returns>
1703 <remarks>The implementation was copied from CLR BinarySearch implementation.</remarks>
1705 <member name="M:System.Collections.Generic.SegmentedList`1.BinarySearch(`0,System.Int32,System.Int32,System.Collections.Generic.IComparer{`0})">
1707 Performs a binary search in a sorted list.
1709 <param name="item">Element to search for.</param>
1710 <param name="low">The lowest index in which to search.</param>
1711 <param name="high">The highest index in which to search.</param>
1712 <param name="comparer">Comparer to use.</param>
1713 <returns>The index </returns>
1715 <member name="M:System.Collections.Generic.SegmentedList`1.Sort">
1717 Sorts the list using default comparer for elements.
1720 <member name="M:System.Collections.Generic.SegmentedList`1.Sort(System.Collections.Generic.IComparer{`0})">
1722 Sorts the list using specified comparer for elements.
1724 <param name="comparer">Comparer to use.</param>
1726 <member name="M:System.Collections.Generic.SegmentedList`1.AppendFrom(System.Collections.Generic.SegmentedList{`0},System.Int32,System.Int32)">
1728 Appends a range of elements from anothe list.
1730 <param name="from">Source list.</param>
1731 <param name="index">Start index in the source list.</param>
1732 <param name="count">Count of elements from the source list to append.</param>
1734 <member name="M:System.Collections.Generic.SegmentedList`1.GetEnumerator">
1736 Returns the enumerator.
1739 <member name="M:System.Collections.Generic.SegmentedList`1.ToArray">
1743 <returns>Array copy</returns>
1745 <member name="M:System.Collections.Generic.SegmentedList`1.CopyTo(`0[],System.Int32)">
1747 CopyTo copies a collection into an Array, starting at a particular
1748 index into the array.
1750 <param name="array">Destination array.</param>
1751 <param name="arrayIndex">Destination array starting index.</param>
1753 <member name="M:System.Collections.Generic.SegmentedList`1.CopyRangeTo(`0[],System.Int32,System.Int32,System.Int32)">
1755 Copies the contents of the collection that are within a range into an Array, starting at a particular
1756 index into the array.
1758 <param name="array">Destination array.</param>
1759 <param name="arrayIndex">Destination array starting index.</param>
1760 <param name="startIndex">The collection index from where the copying should start.</param>
1761 <param name="endIndex">The collection index where the copying should end.</param>
1763 <member name="M:System.Collections.Generic.SegmentedList`1.System#Collections#Generic#IEnumerable{T}#GetEnumerator">
1765 Returns the enumerator.
1768 <member name="M:System.Collections.Generic.SegmentedList`1.System#Collections#IEnumerable#GetEnumerator">
1770 Returns the enumerator.
1773 <member name="M:System.Collections.Generic.SegmentedList`1.System#Collections#Generic#ICollection{T}#Clear">
1775 Clears the list (removes all elements).
1778 <member name="M:System.Collections.Generic.SegmentedList`1.System#Collections#Generic#ICollection{T}#Contains(`0)">
1780 Check if ICollection contains the given element.
1782 <param name="item">Element to check.</param>
1784 <member name="M:System.Collections.Generic.SegmentedList`1.System#Collections#Generic#ICollection{T}#CopyTo(`0[],System.Int32)">
1786 CopyTo copies a collection into an Array, starting at a particular
1787 index into the array.
1789 <param name="array">Destination array.</param>
1790 <param name="arrayIndex">Destination array starting index.</param>
1792 <member name="M:System.Collections.Generic.SegmentedList`1.System#Collections#Generic#ICollection{T}#Remove(`0)">
1794 Removes the given element from this ICollection.
1796 <param name="item">Element to remove.</param>
1798 <member name="M:System.Collections.Generic.SegmentedList`1.AddRoomForElement(System.Int32)">
1800 Shifts the tail of the list to make room for a new inserted element.
1802 <param name="index">Index of a new inserted element.</param>
1804 <member name="M:System.Collections.Generic.SegmentedList`1.RemoveRoomForElement(System.Int32)">
1806 Shifts the tail of the list to remove the element.
1808 <param name="index">Index of the removed element.</param>
1810 <member name="M:System.Collections.Generic.SegmentedList`1.EnsureCapacity(System.Int32)">
1812 Ensures that we have enough capacity for the given number of elements.
1814 <param name="minCapacity">Number of elements.</param>
1816 <member name="M:System.Collections.Generic.SegmentedList`1.SwapIfGreaterWithItems(System.Collections.Generic.IComparer{`0},System.Int32,System.Int32)">
1818 Helper method for QuickSort.
1820 <param name="comparer">Comparer to use.</param>
1821 <param name="a">Position of the first element.</param>
1822 <param name="b">Position of the second element.</param>
1824 <member name="M:System.Collections.Generic.SegmentedList`1.QuickSort(System.Int32,System.Int32,System.Collections.Generic.IComparer{`0})">
1826 QuickSort implementation.
1828 <param name="left">left boundary.</param>
1829 <param name="right">right boundary.</param>
1830 <param name="comparer">Comparer to use.</param>
1831 <remarks>The implementation was copied from CLR QuickSort implementation.</remarks>
1833 <member name="T:System.Collections.Generic.SegmentedList`1.Enumerator">
1835 Enumerator over the segmented list.
1838 <member name="M:System.Collections.Generic.SegmentedList`1.Enumerator.#ctor(System.Collections.Generic.SegmentedList{`0})">
1840 Constructws the Enumerator.
1842 <param name="list">List to enumerate.</param>
1844 <member name="M:System.Collections.Generic.SegmentedList`1.Enumerator.Dispose">
1846 Disposes the Enumerator.
1849 <member name="M:System.Collections.Generic.SegmentedList`1.Enumerator.MoveNext">
1851 Moves to the nest element in the list.
1853 <returns>True if move successful, false if there are no more elements.</returns>
1855 <member name="P:System.Collections.Generic.SegmentedList`1.Enumerator.Current">
1857 Returns the current element.
1860 <member name="P:System.Collections.Generic.SegmentedList`1.Enumerator.System#Collections#IEnumerator#Current">
1862 Returns the current element.
1865 <member name="M:System.Collections.Generic.SegmentedList`1.Enumerator.System#Collections#IEnumerator#Reset">
1867 Resets the enumerator to initial state.