BsonBinaryWriter ClassMongoDB C# Driver API Documentation
Represents a BSON writer to a BSON Stream.
Inheritance Hierarchy

SystemObject
  MongoDB.Bson.IOBsonWriter
    MongoDB.Bson.IOBsonBinaryWriter

Namespace: MongoDB.Bson.IO
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: { version: '1.11.0.92', semver: '1.11.0', commit: '791a16588d4a8b3b118a8b3b57cfa436fec5d3da', commitDate: '2015-12-08 22:55:45' }
Syntax

public class BsonBinaryWriter : BsonWriter

The BsonBinaryWriter type exposes the following members.

Constructors

  NameDescription
Public methodBsonBinaryWriter(Stream, BsonBuffer, BsonBinaryWriterSettings)
Initializes a new instance of the BsonBinaryWriter class.
Public methodBsonBinaryWriter(BsonBuffer, Boolean, BsonBinaryWriterSettings)
Initializes a new instance of the BsonBinaryWriter class.
Top
Methods

  NameDescription
Protected methodCheckElementName
Checks that the element name is valid.
(Inherited from BsonWriter.)
Public methodClose
Closes the writer.
(Overrides BsonWriterClose.)
Public methodDispose
Disposes of any resources used by the writer.
(Inherited from BsonWriter.)
Protected methodDispose(Boolean)
Disposes of any resources used by the writer.
(Overrides BsonWriterDispose(Boolean).)
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.
(Overrides BsonWriterFlush.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(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 methodPopMaxDocumentSize
Pops the max document size stack, restoring the previous max document size.
Public methodPushMaxDocumentSize
Pushes a new max document size onto the max document size stack.
Protected methodThrowInvalidContextType
Throws an InvalidOperationException when the method called is not valid for the current ContextType.
(Inherited from BsonWriter.)
Protected methodThrowInvalidState
Throws an InvalidOperationException when the method called is not valid for the current state.
(Inherited from BsonWriter.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWriteBinaryData(BsonBinaryData)
Writes BSON binary data to the writer.
(Overrides BsonWriterWriteBinaryData(BsonBinaryData).)
Public methodWriteBinaryData(Byte, BsonBinarySubType) Obsolete.
Writes a BSON binary data element to the writer.
(Inherited from BsonWriter.)
Public methodWriteBinaryData(String, BsonBinaryData)
Writes a BSON binary data element to the writer.
(Inherited from BsonWriter.)
Public methodWriteBinaryData(Byte, BsonBinarySubType, GuidRepresentation) Obsolete.
Writes BSON binary data to the writer.
(Inherited from BsonWriter.)
Public methodWriteBinaryData(String, Byte, BsonBinarySubType) Obsolete.
Writes a BSON binary data element to the writer.
(Inherited from BsonWriter.)
Public methodWriteBinaryData(String, Byte, BsonBinarySubType, GuidRepresentation) Obsolete.
Writes a BSON binary data element to the writer.
(Inherited from BsonWriter.)
Public methodWriteBoolean(Boolean)
Writes a BSON Boolean to the writer.
(Overrides BsonWriterWriteBoolean(Boolean).)
Public methodWriteBoolean(String, Boolean)
Writes a BSON Boolean element to the writer.
(Inherited from BsonWriter.)
Public methodWriteBytes(Byte)
Writes BSON binary data to the writer.
(Overrides BsonWriterWriteBytes(Byte).)
Public methodWriteBytes(String, Byte)
Writes a BSON binary data element to the writer.
(Inherited from BsonWriter.)
Public methodWriteDateTime(Int64)
Writes a BSON DateTime to the writer.
(Overrides BsonWriterWriteDateTime(Int64).)
Public methodWriteDateTime(String, Int64)
Writes a BSON DateTime element to the writer.
(Inherited from BsonWriter.)
Public methodWriteDouble(Double)
Writes a BSON Double to the writer.
(Overrides BsonWriterWriteDouble(Double).)
Public methodWriteDouble(String, Double)
Writes a BSON Double element to the writer.
(Inherited from BsonWriter.)
Public methodWriteEndArray
Writes the end of a BSON array to the writer.
(Overrides BsonWriterWriteEndArray.)
Public methodWriteEndDocument
Writes the end of a BSON document to the writer.
(Overrides BsonWriterWriteEndDocument.)
Public methodWriteInt32(Int32)
Writes a BSON Int32 to the writer.
(Overrides BsonWriterWriteInt32(Int32).)
Public methodWriteInt32(String, Int32)
Writes a BSON Int32 element to the writer.
(Inherited from BsonWriter.)
Public methodWriteInt64(Int64)
Writes a BSON Int64 to the writer.
(Overrides BsonWriterWriteInt64(Int64).)
Public methodWriteInt64(String, Int64)
Writes a BSON Int64 element to the writer.
(Inherited from BsonWriter.)
Public methodWriteJavaScript(String)
Writes a BSON JavaScript to the writer.
(Overrides BsonWriterWriteJavaScript(String).)
Public methodWriteJavaScript(String, String)
Writes a BSON JavaScript element to the writer.
(Inherited from BsonWriter.)
Public methodWriteJavaScriptWithScope(String)
Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
(Overrides BsonWriterWriteJavaScriptWithScope(String).)
Public methodWriteJavaScriptWithScope(String, String)
Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).
(Inherited from BsonWriter.)
Public methodWriteMaxKey
Writes a BSON MaxKey to the writer.
(Overrides BsonWriterWriteMaxKey.)
Public methodWriteMaxKey(String)
Writes a BSON MaxKey element to the writer.
(Inherited from BsonWriter.)
Public methodWriteMinKey
Writes a BSON MinKey to the writer.
(Overrides BsonWriterWriteMinKey.)
Public methodWriteMinKey(String)
Writes a BSON MinKey element to the writer.
(Inherited from BsonWriter.)
Public methodWriteName
Writes the name of an element to the writer.
(Inherited from BsonWriter.)
Public methodWriteNull
Writes a BSON null to the writer.
(Overrides BsonWriterWriteNull.)
Public methodWriteNull(String)
Writes a BSON null element to the writer.
(Inherited from BsonWriter.)
Public methodWriteObjectId(ObjectId)
Writes a BSON ObjectId to the writer.
(Overrides BsonWriterWriteObjectId(ObjectId).)
Public methodWriteObjectId(String, ObjectId)
Writes a BSON ObjectId element to the writer.
(Inherited from BsonWriter.)
Public methodWriteObjectId(Int32, Int32, Int16, Int32) Obsolete.
Writes a BSON ObjectId to the writer.
(Inherited from BsonWriter.)
Public methodWriteObjectId(String, Int32, Int32, Int16, Int32) Obsolete.
Writes a BSON ObjectId element to the writer.
(Inherited from BsonWriter.)
Public methodWriteRawBsonArray(IByteBuffer)
Writes a raw BSON array.
(Overrides BsonWriterWriteRawBsonArray(IByteBuffer).)
Public methodWriteRawBsonArray(String, IByteBuffer)
Writes a raw BSON array.
(Inherited from BsonWriter.)
Public methodWriteRawBsonDocument(IByteBuffer)
Writes a raw BSON document.
(Overrides BsonWriterWriteRawBsonDocument(IByteBuffer).)
Public methodWriteRawBsonDocument(String, IByteBuffer)
Writes a raw BSON document.
(Inherited from BsonWriter.)
Public methodWriteRegularExpression(BsonRegularExpression)
Writes a BSON regular expression to the writer.
(Overrides BsonWriterWriteRegularExpression(BsonRegularExpression).)
Public methodWriteRegularExpression(String, BsonRegularExpression)
Writes a BSON regular expression element to the writer.
(Inherited from BsonWriter.)
Public methodWriteRegularExpression(String, String) Obsolete.
Writes a BSON regular expression to the writer.
(Inherited from BsonWriter.)
Public methodWriteRegularExpression(String, String, String) Obsolete.
Writes a BSON regular expression element to the writer.
(Inherited from BsonWriter.)
Public methodWriteStartArray
Writes the start of a BSON array to the writer.
(Overrides BsonWriterWriteStartArray.)
Public methodWriteStartArray(String)
Writes the start of a BSON array element to the writer.
(Inherited from BsonWriter.)
Public methodWriteStartDocument
Writes the start of a BSON document to the writer.
(Overrides BsonWriterWriteStartDocument.)
Public methodWriteStartDocument(String)
Writes the start of a BSON document element to the writer.
(Inherited from BsonWriter.)
Public methodWriteString(String)
Writes a BSON String to the writer.
(Overrides BsonWriterWriteString(String).)
Public methodWriteString(String, String)
Writes a BSON String element to the writer.
(Inherited from BsonWriter.)
Public methodWriteSymbol(String)
Writes a BSON Symbol to the writer.
(Overrides BsonWriterWriteSymbol(String).)
Public methodWriteSymbol(String, String)
Writes a BSON Symbol element to the writer.
(Inherited from BsonWriter.)
Public methodWriteTimestamp(Int64)
Writes a BSON timestamp to the writer.
(Overrides BsonWriterWriteTimestamp(Int64).)
Public methodWriteTimestamp(String, Int64)
Writes a BSON timestamp element to the writer.
(Inherited from BsonWriter.)
Public methodWriteUndefined
Writes a BSON undefined to the writer.
(Overrides BsonWriterWriteUndefined.)
Public methodWriteUndefined(String)
Writes a BSON undefined element to the writer.
(Inherited from BsonWriter.)
Top
Extension Methods

  NameDescription
Public Extension MethodToBson(Type)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
Properties

  NameDescription
Public propertyBuffer
Gets the writer's BsonBuffer.
Public propertyCheckElementNames
Gets or sets whether to check element names (no periods or leading $).
(Inherited from BsonWriter.)
Public propertyCheckUpdateDocument
Gets or sets whether to check an update document (turns CheckElementNames on if first element name does *not* start with $).
(Inherited from BsonWriter.)
Public propertyDisposed
Gets whether the BsonWriter has been disposed.
(Inherited from BsonWriter.)
Protected propertyName
Gets the name of the element being written.
(Inherited from BsonWriter.)
Public propertySerializationDepth
Gets the current serialization depth.
(Inherited from BsonWriter.)
Public propertySettings
Gets the settings of the writer.
(Inherited from BsonWriter.)
Public propertyState
Gets the current state of the writer.
(Inherited from BsonWriter.)
Top
See Also

Reference