Click here to Skip to main content
15,897,518 members
Articles / Programming Languages / C#

A Fast/Compact Serialization Framework

Rate me:
Please Sign up or sign in to vote.
4.85/5 (37 votes)
13 Oct 2010GPL35 min read 284.7K   1.2K   175  
A framework for object serializiation/deserialization that is many times faster and yields a compact output.
<html dir="LTR">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>NxBinaryReader Members</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />
  </head>
  <body id="bodyID" class="dtBODY">
    <div id="nsbanner">
      <div id="bannerrow1">
        <table class="bannerparthead" cellspacing="0">
          <tr id="hdr">
            <td class="runninghead">OpenNxSerialization API Reference</td>
            <td class="product">
            </td>
          </tr>
        </table>
      </div>
      <div id="TitleRow">
        <h1 class="dtH1">NxBinaryReader Members
					</h1>
      </div>
    </div>
    <div id="nstext">
      <p>
        <a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.html">NxBinaryReader overview</a>
      </p>
      <h4 class="dtH4">Public Instance Constructors</h4>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
          <tr VALIGN="top">
            <td width="50%">
              <img src="pubmethod.gif" />
              <a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReaderConstructor.html">NxBinaryReader</a>
            </td>
            <td width="50%">Overloaded. Initializes a new instance of the NxBinaryReader class.</td>
          </tr>
        </table>
      </div>
      <h4 class="dtH4">Public Instance Properties</h4>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
<tr VALIGN="top"><td width="50%"><img src="pubproperty.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.SurrogateSelector.html">SurrogateSelector</a></td><td width="50%"> Returns the associated <a href="NeXtreme.OpenNxSerialization.NxTypeSurrogateSelector.html">NxTypeSurrogateSelector</a> instance. </td></tr></table>
      </div>
      <h4 class="dtH4">Public Instance Methods</h4>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.Dispose_overload_1.html">Dispose</a></td><td width="50%">Overloaded.  Close the underlying <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOBinaryWriterClassTopic.asp">BinaryWriter</a>. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassEqualsTopic.asp">Equals</a> (inherited from <b>Object</b>)</td><td width="50%">Determines whether the specified <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassTopic.asp">Object</a> is equal to the current <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassTopic.asp">Object</a>.</td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassGetHashCodeTopic.asp">GetHashCode</a> (inherited from <b>Object</b>)</td><td width="50%">Serves as a hash function for a particular type. <b>GetHashCode</b> is suitable for use in hashing algorithms and data structures like a hash table.</td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassGetTypeTopic.asp">GetType</a> (inherited from <b>Object</b>)</td><td width="50%">Gets the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemTypeClassTopic.asp">Type</a> of the current instance.</td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.Read_overloads.html">Read</a></td><td width="50%">Overloaded.  Reads the specifies number of bytes into <i>buffer</i>. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadBoolean.html">ReadBoolean</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemBooleanClassTopic.asp">Boolean</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadByte.html">ReadByte</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemByteClassTopic.asp">Byte</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadBytes.html">ReadBytes</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemByteClassTopic.asp">Byte</a>[] from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadChar.html">ReadChar</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCharClassTopic.asp">Char</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadChars.html">ReadChars</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCharClassTopic.asp">Char</a>[] from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadDateTime.html">ReadDateTime</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDateTimeClassTopic.asp">DateTime</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadDecimal.html">ReadDecimal</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDecimalClassTopic.asp">Decimal</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadDouble.html">ReadDouble</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDoubleClassTopic.asp">Double</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadGuid.html">ReadGuid</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemGuidClassTopic.asp">Guid</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadInt16.html">ReadInt16</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemInt16ClassTopic.asp">Int16</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadInt32.html">ReadInt32</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemInt32ClassTopic.asp">Int32</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadInt64.html">ReadInt64</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemInt64ClassTopic.asp">Int64</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadObject.html">ReadObject</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassTopic.asp">Object</a> from the current stream and advances the stream position. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadObjectAs.html">ReadObjectAs</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassTopic.asp">Object</a> from the current stream and advances the stream position. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadSByte.html">ReadSByte</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemSByteClassTopic.asp">SByte</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadSingle.html">ReadSingle</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemSingleClassTopic.asp">Single</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadString.html">ReadString</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemStringClassTopic.asp">String</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadUInt16.html">ReadUInt16</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemUInt16ClassTopic.asp">UInt16</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadUInt32.html">ReadUInt32</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemUInt32ClassTopic.asp">UInt32</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.ReadUInt64.html">ReadUInt64</a></td><td width="50%"> Reads an object of type <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemUInt64ClassTopic.asp">UInt64</a> from the current stream and advances the stream position. This method reads directly from the underlying stream. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassToStringTopic.asp">ToString</a> (inherited from <b>Object</b>)</td><td width="50%">Returns a <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemStringClassTopic.asp">String</a> that represents the current <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassTopic.asp">Object</a>.</td></tr></table>
      </div>
      <h4 class="dtH4">Protected Instance Methods</h4>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
<tr VALIGN="top"><td width="50%"><img src="protmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.Dispose_overload_2.html">Dispose</a></td><td width="50%">Overloaded.  Close the underlying <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOBinaryWriterClassTopic.asp">BinaryWriter</a>. </td></tr>
<tr VALIGN="top"><td width="50%"><img src="protmethod.gif"></img><a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.Finalize.html">Finalize</a></td><td width="50%"> Finalizer </td></tr>
<tr VALIGN="top"><td width="50%"><img src="protmethod.gif"></img><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassMemberwiseCloneTopic.asp">MemberwiseClone</a> (inherited from <b>Object</b>)</td><td width="50%">Creates a shallow copy of the current <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassTopic.asp">Object</a>.</td></tr></table>
      </div>
      <h4 class="dtH4">See Also</h4>
      <p>
        <a href="NeXtreme.OpenNxSerialization.IO.NxBinaryReader.html">NxBinaryReader Class</a> | <a href="NeXtreme.OpenNxSerialization.IO.html">NeXtreme.OpenNxSerialization.IO Namespace</a></p>
      <hr />
      <div id="footer">
        <p>
          <a href="mailto:alleey@gmail.com?subject=OpenNxSerialization%20API%20Reference%20Documentation%20Feedback:%20NxBinaryReader%20Members&#xD;&#xA;						">Send comments on this topic.</a>
        </p>
        <p>
          <a>Copyright (C) 2006 - 2007, NeXtreme Innovations. All rights reserved.</a>
        </p>
        <p>Generated from assembly NeXtreme.OpenNxSerialization [1.0.0.0]</p>
      </div>
    </div>
  </body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Architect
Pakistan Pakistan
Let a = b ....... (1)
a - b = a - b
a^2 - ab = a^2 - ab
a^2 - ab = a^2 - b^2 (from 1)
a (a - b) = (a + b) (a - b)
a = (a + b) ...... (2)

if a = 1
1 = (1 + 1) (from 1 & 2)
1 = 2 !!

Comments and Discussions