| BsonBinaryWriter Class | 
 Inheritance Hierarchy
Inheritance HierarchyNamespace: MongoDB.Bson.IO
 Syntax
SyntaxThe BsonBinaryWriter type exposes the following members.
 Constructors
Constructors| Name | Description | |
|---|---|---|
|  | BsonBinaryWriter(Stream) | 
            Initializes a new instance of the BsonBinaryWriter class.
             | 
|  | BsonBinaryWriter(Stream, BsonBinaryWriterSettings) | 
            Initializes a new instance of the BsonBinaryWriter class.
             | 
 Properties
Properties| Name | Description | |
|---|---|---|
|  | BaseStream | 
            Gets the base stream.
             | 
|  | BsonStream | 
            Gets the BSON stream.
             | 
|  | Disposed | 
            Gets whether the BsonWriter has been disposed.
            (Inherited from BsonWriter.) | 
|  | Name | 
            Gets the name of the element being written.
            (Inherited from BsonWriter.) | 
|  | Position | 
            Gets the position.
            Not all writers are able to report the position. Those that can't simply return zero.
            (Overrides BsonWriterPosition.) | 
|  | SerializationDepth | 
            Gets the current serialization depth.
            (Inherited from BsonWriter.) | 
|  | Settings | 
            Gets the settings of the writer.
             | 
|  | State | 
            Gets the current state of the writer.
            (Inherited from BsonWriter.) | 
 Methods
Methods| Name | Description | |
|---|---|---|
|  | Close | 
            Closes the writer. Also closes the base stream.
            (Overrides BsonWriterClose.) | 
|  | Dispose | 
            Disposes of any resources used by the writer.
            (Inherited from BsonWriter.) | 
|  | Dispose(Boolean) | 
            Disposes of any resources used by the writer.
            (Overrides BsonWriterDispose(Boolean).) | 
|  | Equals | Determines whether the specified object is equal to the current object.(Inherited from Object.) | 
|  | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) | 
|  | Flush | 
            Flushes any pending data to the output destination.
            (Overrides BsonWriterFlush.) | 
|  | GetHashCode | Serves as the default hash function. (Inherited from Object.) | 
|  | GetType | Gets the Type of the current instance.(Inherited from Object.) | 
|  | MemberwiseClone | Creates a shallow copy of the current Object.(Inherited from Object.) | 
|  | PopElementNameValidator | 
            Pops the element name validator.
            (Inherited from BsonWriter.) | 
|  | PopMaxDocumentSize | Obsolete. 
            Pops the max document size stack, restoring the previous max document size.
             | 
|  | PopSettings | 
            Pops the settings.
            (Inherited from BsonWriter.) | 
|  | PushElementNameValidator | 
            Pushes the element name validator.
            (Inherited from BsonWriter.) | 
|  | PushMaxDocumentSize | Obsolete. 
            Pushes a new max document size onto the max document size stack.
             | 
|  | PushSettings | 
            Pushes new settings for the writer.
            (Inherited from BsonWriter.) | 
|  | ThrowInvalidContextType | 
            Throws an InvalidOperationException when the method called is not valid for the current ContextType.
            (Inherited from BsonWriter.) | 
|  | ThrowInvalidState | 
            Throws an InvalidOperationException when the method called is not valid for the current state.
            (Inherited from BsonWriter.) | 
|  | ToString | Returns a string that represents the current object.(Inherited from Object.) | 
|  | WriteBinaryData | 
            Writes BSON binary data to the writer.
            (Overrides BsonWriterWriteBinaryData(BsonBinaryData).) | 
|  | WriteBoolean | 
            Writes a BSON Boolean to the writer.
            (Overrides BsonWriterWriteBoolean(Boolean).) | 
|  | WriteBytes | 
            Writes BSON binary data to the writer.
            (Overrides BsonWriterWriteBytes(Byte).) | 
|  | WriteDateTime | 
            Writes a BSON DateTime to the writer.
            (Overrides BsonWriterWriteDateTime(Int64).) | 
|  | WriteDecimal128 | 
            Writes a BSON Decimal128 to the writer.
            (Overrides BsonWriterWriteDecimal128(Decimal128).) | 
|  | WriteDouble | 
            Writes a BSON Double to the writer.
            (Overrides BsonWriterWriteDouble(Double).) | 
|  | WriteEndArray | 
            Writes the end of a BSON array to the writer.
            (Overrides BsonWriterWriteEndArray.) | 
|  | WriteEndDocument | 
            Writes the end of a BSON document to the writer.
            (Overrides BsonWriterWriteEndDocument.) | 
|  | WriteInt32 | 
            Writes a BSON Int32 to the writer.
            (Overrides BsonWriterWriteInt32(Int32).) | 
|  | WriteInt64 | 
            Writes a BSON Int64 to the writer.
            (Overrides BsonWriterWriteInt64(Int64).) | 
|  | WriteJavaScript | 
            Writes a BSON JavaScript to the writer.
            (Overrides BsonWriterWriteJavaScript(String).) | 
|  | WriteJavaScriptWithScope | 
            Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
            (Overrides BsonWriterWriteJavaScriptWithScope(String).) | 
|  | WriteMaxKey | 
            Writes a BSON MaxKey to the writer.
            (Overrides BsonWriterWriteMaxKey.) | 
|  | WriteMinKey | 
            Writes a BSON MinKey to the writer.
            (Overrides BsonWriterWriteMinKey.) | 
|  | WriteName | 
            Writes the name of an element to the writer.
            (Inherited from BsonWriter.) | 
|  | WriteNull | 
            Writes a BSON null to the writer.
            (Overrides BsonWriterWriteNull.) | 
|  | WriteObjectId | 
            Writes a BSON ObjectId to the writer.
            (Overrides BsonWriterWriteObjectId(ObjectId).) | 
|  | WriteRawBsonArray | 
            Writes a raw BSON array.
            (Overrides BsonWriterWriteRawBsonArray(IByteBuffer).) | 
|  | WriteRawBsonDocument | 
            Writes a raw BSON document.
            (Overrides BsonWriterWriteRawBsonDocument(IByteBuffer).) | 
|  | WriteRegularExpression | 
            Writes a BSON regular expression to the writer.
            (Overrides BsonWriterWriteRegularExpression(BsonRegularExpression).) | 
|  | WriteStartArray | 
            Writes the start of a BSON array to the writer.
            (Overrides BsonWriterWriteStartArray.) | 
|  | WriteStartDocument | 
            Writes the start of a BSON document to the writer.
            (Overrides BsonWriterWriteStartDocument.) | 
|  | WriteString | 
            Writes a BSON String to the writer.
            (Overrides BsonWriterWriteString(String).) | 
|  | WriteSymbol | 
            Writes a BSON Symbol to the writer.
            (Overrides BsonWriterWriteSymbol(String).) | 
|  | WriteTimestamp | 
            Writes a BSON timestamp to the writer.
            (Overrides BsonWriterWriteTimestamp(Int64).) | 
|  | WriteUndefined | 
            Writes a BSON undefined to the writer.
            (Overrides BsonWriterWriteUndefined.) | 
 Extension Methods
Extension Methods| Name | Description | |
|---|---|---|
|  | ToBson | 
            Serializes an object to a BSON byte array.
            (Defined by BsonExtensionMethods.) | 
|  | ToBsonDocument | 
            Serializes an object to a BsonDocument.
            (Defined by BsonExtensionMethods.) | 
|  | ToJson | 
            Serializes an object to a JSON string.
            (Defined by BsonExtensionMethods.) | 
 See Also
See Also