Interface IBsonWriter
Represents a BSON writer.
public interface IBsonWriter : IDisposable
- Inherited Members
- Extension Methods
Properties
Position
Gets the position. Not all writers are able to report the position. Those that can't simply return zero.
long Position { get; }
Property Value
- long
The position.
- See Also
SerializationDepth
Gets the current serialization depth.
int SerializationDepth { get; }
Property Value
- See Also
Settings
Gets the settings of the writer.
BsonWriterSettings Settings { get; }
Property Value
- See Also
State
Gets the current state of the writer.
BsonWriterState State { get; }
Property Value
- See Also
Methods
Close()
Closes the writer.
void Close()
- See Also
Flush()
Flushes any pending data to the output destination.
void Flush()
- See Also
PopElementNameValidator()
Pops the element name validator.
void PopElementNameValidator()
- See Also
PopSettings()
Pops the settings.
void PopSettings()
- See Also
PushElementNameValidator(IElementNameValidator)
Pushes the element name validator.
void PushElementNameValidator(IElementNameValidator validator)
Parameters
validator
IElementNameValidatorThe validator.
- See Also
PushSettings(Action<BsonWriterSettings>)
Pushes new settings for the writer.
void PushSettings(Action<BsonWriterSettings> configurator)
Parameters
configurator
Action<BsonWriterSettings>The settings configurator.
- See Also
WriteBinaryData(BsonBinaryData)
Writes BSON binary data to the writer.
void WriteBinaryData(BsonBinaryData binaryData)
Parameters
binaryData
BsonBinaryDataThe binary data.
- See Also
WriteBoolean(bool)
Writes a BSON Boolean to the writer.
void WriteBoolean(bool value)
Parameters
value
boolThe Boolean value.
- See Also
WriteBytes(byte[])
Writes BSON binary data to the writer.
void WriteBytes(byte[] bytes)
Parameters
bytes
byte[]The bytes.
- See Also
WriteDateTime(long)
Writes a BSON DateTime to the writer.
void WriteDateTime(long value)
Parameters
value
longThe number of milliseconds since the Unix epoch.
- See Also
WriteDecimal128(Decimal128)
Writes a BSON Decimal128 to the writer.
void WriteDecimal128(Decimal128 value)
Parameters
value
Decimal128The Decimal128 value.
- See Also
WriteDouble(double)
Writes a BSON Double to the writer.
void WriteDouble(double value)
Parameters
value
doubleThe Double value.
- See Also
WriteEndArray()
Writes the end of a BSON array to the writer.
void WriteEndArray()
- See Also
WriteEndDocument()
Writes the end of a BSON document to the writer.
void WriteEndDocument()
- See Also
WriteInt32(int)
Writes a BSON Int32 to the writer.
void WriteInt32(int value)
Parameters
value
intThe Int32 value.
- See Also
WriteInt64(long)
Writes a BSON Int64 to the writer.
void WriteInt64(long value)
Parameters
value
longThe Int64 value.
- See Also
WriteJavaScript(string)
Writes a BSON JavaScript to the writer.
void WriteJavaScript(string code)
Parameters
code
stringThe JavaScript code.
- See Also
WriteJavaScriptWithScope(string)
Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
void WriteJavaScriptWithScope(string code)
Parameters
code
stringThe JavaScript code.
- See Also
WriteMaxKey()
Writes a BSON MaxKey to the writer.
void WriteMaxKey()
- See Also
WriteMinKey()
Writes a BSON MinKey to the writer.
void WriteMinKey()
- See Also
WriteName(string)
Writes the name of an element to the writer.
void WriteName(string name)
Parameters
name
stringThe name of the element.
- See Also
WriteNull()
Writes a BSON null to the writer.
void WriteNull()
- See Also
WriteObjectId(ObjectId)
Writes a BSON ObjectId to the writer.
void WriteObjectId(ObjectId objectId)
Parameters
objectId
ObjectIdThe ObjectId.
- See Also
WriteRawBsonArray(IByteBuffer)
Writes a raw BSON array.
void WriteRawBsonArray(IByteBuffer slice)
Parameters
slice
IByteBufferThe byte buffer containing the raw BSON array.
- See Also
WriteRawBsonDocument(IByteBuffer)
Writes a raw BSON document.
void WriteRawBsonDocument(IByteBuffer slice)
Parameters
slice
IByteBufferThe byte buffer containing the raw BSON document.
- See Also
WriteRegularExpression(BsonRegularExpression)
Writes a BSON regular expression to the writer.
void WriteRegularExpression(BsonRegularExpression regex)
Parameters
regex
BsonRegularExpressionA BsonRegularExpression.
- See Also
WriteStartArray()
Writes the start of a BSON array to the writer.
void WriteStartArray()
- See Also
WriteStartDocument()
Writes the start of a BSON document to the writer.
void WriteStartDocument()
- See Also
WriteString(string)
Writes a BSON String to the writer.
void WriteString(string value)
Parameters
value
stringThe String value.
- See Also
WriteSymbol(string)
Writes a BSON Symbol to the writer.
void WriteSymbol(string value)
Parameters
value
stringThe symbol.
- See Also
WriteTimestamp(long)
Writes a BSON timestamp to the writer.
void WriteTimestamp(long value)
Parameters
value
longThe combined timestamp/increment value.
- See Also
WriteUndefined()
Writes a BSON undefined to the writer.
void WriteUndefined()
- See Also