Class WrappingBsonWriter
An abstract base class for an IBsonWriter that wraps another IBsonWriter.
public abstract class WrappingBsonWriter : IBsonWriter, IDisposable
- Inheritance
-
WrappingBsonWriter
- Implements
- Inherited Members
- Extension Methods
Constructors
WrappingBsonWriter(IBsonWriter)
Initializes a new instance of the WrappingBsonWriter class.
public WrappingBsonWriter(IBsonWriter wrapped)
Parameters
wrapped
IBsonWriterThe wrapped writer.
- See Also
Properties
Position
Gets the position. Not all writers are able to report the position. Those that can't simply return zero.
public virtual long Position { get; }
Property Value
- long
The position.
- See Also
SerializationDepth
Gets the current serialization depth.
public virtual int SerializationDepth { get; }
Property Value
- See Also
Settings
Gets the settings of the writer.
public virtual BsonWriterSettings Settings { get; }
Property Value
- See Also
State
Gets the current state of the writer.
public virtual BsonWriterState State { get; }
Property Value
- See Also
Wrapped
Gets the wrapped writer.
public IBsonWriter Wrapped { get; }
Property Value
- IBsonWriter
The wrapped writer.
- See Also
Methods
Close()
Closes the writer.
public virtual void Close()
- See Also
Dispose()
public void Dispose()
- See Also
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
booltrue
to release both managed and unmanaged resources;false
to release only unmanaged resources.
- See Also
Flush()
Flushes any pending data to the output destination.
public virtual void Flush()
- See Also
PopElementNameValidator()
Pops the element name validator.
public virtual void PopElementNameValidator()
- See Also
PopSettings()
Pops the settings.
public virtual void PopSettings()
- See Also
PushElementNameValidator(IElementNameValidator)
Pushes the element name validator.
public virtual void PushElementNameValidator(IElementNameValidator validator)
Parameters
validator
IElementNameValidatorThe validator.
- See Also
PushSettings(Action<BsonWriterSettings>)
Pushes new settings for the writer.
public virtual void PushSettings(Action<BsonWriterSettings> configurator)
Parameters
configurator
Action<BsonWriterSettings>The settings configurator.
- See Also
ThrowIfDisposed()
Throws if disposed.
protected void ThrowIfDisposed()
Exceptions
- See Also
WriteBinaryData(BsonBinaryData)
Writes BSON binary data to the writer.
public virtual void WriteBinaryData(BsonBinaryData binaryData)
Parameters
binaryData
BsonBinaryDataThe binary data.
- See Also
WriteBoolean(bool)
Writes a BSON Boolean to the writer.
public virtual void WriteBoolean(bool value)
Parameters
value
boolThe Boolean value.
- See Also
WriteBytes(byte[])
Writes BSON binary data to the writer.
public virtual void WriteBytes(byte[] bytes)
Parameters
bytes
byte[]The bytes.
- See Also
WriteDateTime(long)
Writes a BSON DateTime to the writer.
public virtual 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.
public virtual void WriteDecimal128(Decimal128 value)
Parameters
value
Decimal128The Decimal128 value.
- See Also
WriteDouble(double)
Writes a BSON Double to the writer.
public virtual void WriteDouble(double value)
Parameters
value
doubleThe Double value.
- See Also
WriteEndArray()
Writes the end of a BSON array to the writer.
public virtual void WriteEndArray()
- See Also
WriteEndDocument()
Writes the end of a BSON document to the writer.
public virtual void WriteEndDocument()
- See Also
WriteInt32(int)
Writes a BSON Int32 to the writer.
public virtual void WriteInt32(int value)
Parameters
value
intThe Int32 value.
- See Also
WriteInt64(long)
Writes a BSON Int64 to the writer.
public virtual void WriteInt64(long value)
Parameters
value
longThe Int64 value.
- See Also
WriteJavaScript(string)
Writes a BSON JavaScript to the writer.
public virtual 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).
public virtual void WriteJavaScriptWithScope(string code)
Parameters
code
stringThe JavaScript code.
- See Also
WriteMaxKey()
Writes a BSON MaxKey to the writer.
public virtual void WriteMaxKey()
- See Also
WriteMinKey()
Writes a BSON MinKey to the writer.
public virtual void WriteMinKey()
- See Also
WriteName(string)
Writes the name of an element to the writer.
public virtual void WriteName(string name)
Parameters
name
stringThe name of the element.
- See Also
WriteNull()
Writes a BSON null to the writer.
public virtual void WriteNull()
- See Also
WriteObjectId(ObjectId)
Writes a BSON ObjectId to the writer.
public virtual void WriteObjectId(ObjectId objectId)
Parameters
objectId
ObjectIdThe ObjectId.
- See Also
WriteRawBsonArray(IByteBuffer)
Writes a raw BSON array.
public virtual void WriteRawBsonArray(IByteBuffer slice)
Parameters
slice
IByteBufferThe byte buffer containing the raw BSON array.
- See Also
WriteRawBsonDocument(IByteBuffer)
Writes a raw BSON document.
public virtual 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.
public virtual void WriteRegularExpression(BsonRegularExpression regex)
Parameters
regex
BsonRegularExpressionA BsonRegularExpression.
- See Also
WriteStartArray()
Writes the start of a BSON array to the writer.
public virtual void WriteStartArray()
- See Also
WriteStartDocument()
Writes the start of a BSON document to the writer.
public virtual void WriteStartDocument()
- See Also
WriteString(string)
Writes a BSON String to the writer.
public virtual void WriteString(string value)
Parameters
value
stringThe String value.
- See Also
WriteSymbol(string)
Writes a BSON Symbol to the writer.
public virtual void WriteSymbol(string value)
Parameters
value
stringThe symbol.
- See Also
WriteTimestamp(long)
Writes a BSON timestamp to the writer.
public virtual void WriteTimestamp(long value)
Parameters
value
longThe combined timestamp/increment value.
- See Also
WriteUndefined()
Writes a BSON undefined to the writer.
public virtual void WriteUndefined()
- See Also