public WriteRegularExpression ( BsonRegularExpression regex ) : void | ||
regex | BsonRegularExpression | A BsonRegularExpression. |
return | void |
public override void WriteRegularExpression(BsonRegularExpression regex)
{
if (Disposed) { throw new ObjectDisposedException("BsonBinaryWriter"); }
if (State != BsonWriterState.Value)
{
ThrowInvalidState("WriteRegularExpression", BsonWriterState.Value);
}
_buffer.WriteByte((byte)BsonType.RegularExpression);
WriteNameHelper();
_buffer.WriteCString(_binaryWriterSettings.Encoding, regex.Pattern);
_buffer.WriteCString(_binaryWriterSettings.Encoding, regex.Options);
State = GetNextState();
}