Click or drag to resize
BsonWriter Class
Represents a BSON writer for some external format (see subclasses).
Inheritance Hierarchy

Namespace: MongoDB.Bson.IO
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: 2.1.0
Syntax
public abstract class BsonWriter : IBsonWriter, 
	IDisposable

The BsonWriter type exposes the following members.

Constructors
  NameDescription
Protected methodBsonWriter
Initializes a new instance of the BsonWriter class.
Top
Methods
  NameDescription
Public methodClose
Closes the writer.
Public methodDispose
Disposes of any resources used by the writer.
Protected methodDispose(Boolean)
Disposes of any resources used by the writer.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlush
Flushes any pending data to the output destination.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPopElementNameValidator
Pops the element name validator.
Public methodPushElementNameValidator
Pushes the element name validator.
Protected methodThrowInvalidContextType
Throws an InvalidOperationException when the method called is not valid for the current ContextType.
Protected methodThrowInvalidState
Throws an InvalidOperationException when the method called is not valid for the current state.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWriteBinaryData
Writes BSON binary data to the writer.
Public methodWriteBoolean
Writes a BSON Boolean to the writer.
Public methodWriteBytes
Writes BSON binary data to the writer.
Public methodWriteDateTime
Writes a BSON DateTime to the writer.
Public methodWriteDouble
Writes a BSON Double to the writer.
Public methodWriteEndArray
Writes the end of a BSON array to the writer.
Public methodWriteEndDocument
Writes the end of a BSON document to the writer.
Public methodWriteInt32
Writes a BSON Int32 to the writer.
Public methodWriteInt64
Writes a BSON Int64 to the writer.
Public methodWriteJavaScript
Writes a BSON JavaScript to the writer.
Public methodWriteJavaScriptWithScope
Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
Public methodWriteMaxKey
Writes a BSON MaxKey to the writer.
Public methodWriteMinKey
Writes a BSON MinKey to the writer.
Public methodWriteName
Writes the name of an element to the writer.
Public methodWriteNull
Writes a BSON null to the writer.
Public methodWriteObjectId
Writes a BSON ObjectId to the writer.
Public methodWriteRawBsonArray
Writes a raw BSON array.
Public methodWriteRawBsonDocument
Writes a raw BSON document.
Public methodWriteRegularExpression
Writes a BSON regular expression to the writer.
Public methodWriteStartArray
Writes the start of a BSON array to the writer.
Public methodWriteStartDocument
Writes the start of a BSON document to the writer.
Public methodWriteString
Writes a BSON String to the writer.
Public methodWriteSymbol
Writes a BSON Symbol to the writer.
Public methodWriteTimestamp
Writes a BSON timestamp to the writer.
Public methodWriteUndefined
Writes a BSON undefined to the writer.
Top
Extension Methods
  NameDescription
Public Extension MethodToBson
Serializes an object to a BSON byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument
Serializes an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson
Serializes an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodWriteBinaryData
Writes a BSON binary data element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteBoolean
Writes a BSON Boolean element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteBytes
Writes a BSON binary data element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteDateTime
Writes a BSON DateTime element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteDouble
Writes a BSON Double element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteInt32
Writes a BSON Int32 element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteInt64
Writes a BSON Int64 element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteJavaScript
Writes a BSON JavaScript element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteJavaScriptWithScope
Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteMaxKey
Writes a BSON MaxKey element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteMinKey
Writes a BSON MinKey element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteNull
Writes a BSON null element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteObjectId
Writes a BSON ObjectId element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteRawBsonArray
Writes a raw BSON array.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteRawBsonDocument
Writes a raw BSON document.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteRegularExpression
Writes a BSON regular expression element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteStartArray
Writes the start of a BSON array element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteStartDocument
Writes the start of a BSON document element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteString
Writes a BSON String element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteSymbol
Writes a BSON Symbol element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteTimestamp
Writes a BSON timestamp element to the writer.
(Defined by IBsonWriterExtensions.)
Public Extension MethodWriteUndefined
Writes a BSON undefined element to the writer.
(Defined by IBsonWriterExtensions.)
Top
Properties
  NameDescription
Public propertyDisposed
Gets whether the BsonWriter has been disposed.
Protected propertyName
Gets the name of the element being written.
Public propertySerializationDepth
Gets the current serialization depth.
Public propertySettings
Gets the settings of the writer.
Public propertyState
Gets the current state of the writer.
Top
See Also