示例#1
0
 /// <summary>
 /// Initialize a FieldReader to read the specified stream using
 /// the provided encoding for strings.  Also, share state with the
 /// specified parent reader.
 /// </summary>
 /// <param name="stream">Data to be read</param>
 /// <param name="stringList">The cache of unique strings that have been previously read</param>
 /// <param name="majorVersion">Major version of the serialization protocol</param>
 /// <param name="minorVersion">Minor version of the serialization protocol</param>
 public FieldReader(Stream stream, UniqueStringList stringList, int majorVersion, int minorVersion)
 {
     m_Stream       = stream;
     m_Encoding     = new UTF8Encoding();
     m_Strings      = stringList;
     m_MajorVersion = majorVersion;
     m_MinorVersion = minorVersion;
 }
示例#2
0
 /// <summary>
 /// Initialize a FieldReader to read the specified data using
 /// the default encoding for strings.  Also, share state with the
 /// specified parent reader.
 /// </summary>
 /// <param name="data">Data to be read</param>
 /// <param name="stringList">The cache of unique strings that have been previously read</param>
 public FieldReader(byte[] data, UniqueStringList stringList)
     : this(new MemoryStream(data), stringList, FileHeader.DefaultMajorVersion, FileHeader.DefaultMinorVersion)
 {
 }
示例#3
0
 /// <summary>
 /// Initialize a FieldWriter to write to the specified stream using
 /// the provided encoding for strings.
 /// </summary>
 /// <param name="stream">Stream to write data into</param>
 public FieldWriter(Stream stream) : this(stream, new UniqueStringList(), FileHeader.DefaultMajorVersion, FileHeader.DefaultMinorVersion)
 {
     m_Stream   = stream;
     m_Encoding = new UTF8Encoding();
     m_Strings  = new UniqueStringList();
 }