CSMongo.IO.DynamicStream.ToArray C# (CSharp) Method

ToArray() public method

Returns all of the bytes for the stream as an array
public ToArray ( ) : byte[]
return byte[]
        public byte[] ToArray()
        {
            if (this._Generated == null) {
                this._Generated = this._Output.ToArray();
            }
            return this._Generated;
        }

Usage Example

Example #1
0
 /// <summary>
 /// Writes a the bytes for a CS string in BSON format
 /// </summary>
 public static byte[] AsCString(string value)
 {
     var stream = new DynamicStream();
     stream.Append(AsString(value));
     stream.InsertAt(0, BitConverter.GetBytes(stream.Length));
     return stream.ToArray();
 }
All Usage Examples Of CSMongo.IO.DynamicStream::ToArray