示例#1
0
文件: Element.cs 项目: soltys/Melange
        public ReadOnlySpan <byte> GetBytes()
        {
            var elementBytes = new List <byte>();

            elementBytes.Add((byte)Value.Type);
            elementBytes.AddRange(BsonEncoder.EncodeAsCString(Name));
            elementBytes.AddRange(Value.GetBytes().ToArray());
            return(elementBytes.ToArray());
        }
示例#2
0
 public override ReadOnlySpan <byte> GetBytes() => BsonEncoder.EncodeAsDocument(ToElements());
示例#3
0
 public override ReadOnlySpan <byte> GetBytes() => BsonEncoder.EncodeAsString(Value);
示例#4
0
 public override ReadOnlySpan <byte> GetBytes() => BsonEncoder.EncodeAsDocument(this.elements);