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()); }
public override ReadOnlySpan <byte> GetBytes() => BsonEncoder.EncodeAsDocument(ToElements());
public override ReadOnlySpan <byte> GetBytes() => BsonEncoder.EncodeAsString(Value);
public override ReadOnlySpan <byte> GetBytes() => BsonEncoder.EncodeAsDocument(this.elements);