Click or drag to resize
Json.NETBsonWriter Class
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
Inheritance Hierarchy

Namespace: Newtonsoft.Json.Bson
Assembly: Newtonsoft.Json (in Newtonsoft.Json.dll) Version: (
public class BsonWriter : JsonWriter

The BsonWriter type exposes the following members.

Public methodBsonWriter(BinaryWriter)
Initializes a new instance of the BsonWriter class.
Public methodBsonWriter(Stream)
Initializes a new instance of the BsonWriter class.
Public methodClose
Closes this stream and the underlying stream.
(Overrides JsonWriterClose.)
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 whatever is in the buffer to the underlying streams and also flushes the underlying stream.
(Overrides JsonWriterFlush.)
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.)
Protected methodSetWriteState
Sets the state of the JsonWriter,
(Inherited from JsonWriter.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWriteComment
Writes out a comment
containing the specified text.
(Overrides JsonWriterWriteComment(String).)
Public methodWriteEnd
Writes the end of the current JSON object or array.
(Inherited from JsonWriter.)
Protected methodWriteEnd(JsonToken)
Writes the end.
(Overrides JsonWriterWriteEnd(JsonToken).)
Public methodWriteEndArray
Writes the end of an array.
(Inherited from JsonWriter.)
Public methodWriteEndConstructor
Writes the end constructor.
(Inherited from JsonWriter.)
Public methodWriteEndObject
Writes the end of a JSON object.
(Inherited from JsonWriter.)
Protected methodWriteIndent
Writes indent characters.
(Inherited from JsonWriter.)
Protected methodWriteIndentSpace
Writes an indent space.
(Inherited from JsonWriter.)
Public methodWriteNull
Writes a null value.
(Overrides JsonWriterWriteNull.)
Public methodWriteObjectId
Writes a Byte[] value that represents a BSON object id.
Public methodWritePropertyName(String)
Writes the property name of a name/value pair on a JSON object.
(Overrides JsonWriterWritePropertyName(String).)
Public methodWritePropertyName(String, Boolean)
Writes the property name of a name/value pair on a JSON object.
(Inherited from JsonWriter.)
Public methodWriteRaw
Writes raw JSON.
(Overrides JsonWriterWriteRaw(String).)
Public methodWriteRawValue
Writes raw JSON where a value is expected and updates the writer's state.
(Overrides JsonWriterWriteRawValue(String).)
Public methodWriteRegex
Writes a BSON regex.
Public methodWriteStartArray
Writes the beginning of a JSON array.
(Overrides JsonWriterWriteStartArray.)
Public methodWriteStartConstructor
Writes the start of a constructor with the given name.
(Overrides JsonWriterWriteStartConstructor(String).)
Public methodWriteStartObject
Writes the beginning of a JSON object.
(Overrides JsonWriterWriteStartObject.)
Public methodWriteToken(JsonReader)
Writes the current JsonReader token and its children.
(Inherited from JsonWriter.)
Public methodWriteToken(JsonToken)
Writes the JsonToken token.
(Inherited from JsonWriter.)
Public methodWriteToken(JsonReader, Boolean)
Writes the current JsonReader token.
(Inherited from JsonWriter.)
Public methodWriteToken(JsonToken, Object)
Writes the JsonToken token and its value.
(Inherited from JsonWriter.)
Public methodWriteUndefined
Writes an undefined value.
(Overrides JsonWriterWriteUndefined.)
Public methodWriteValue(NullableBoolean) (Inherited from JsonWriter.)
Public methodWriteValue(NullableByte) (Inherited from JsonWriter.)
Public methodWriteValue(NullableChar) (Inherited from JsonWriter.)
Public methodWriteValue(NullableDateTime) (Inherited from JsonWriter.)
Public methodWriteValue(NullableDateTimeOffset) (Inherited from JsonWriter.)
Public methodWriteValue(NullableDecimal) (Inherited from JsonWriter.)
Public methodWriteValue(NullableDouble) (Inherited from JsonWriter.)
Public methodWriteValue(NullableGuid) (Inherited from JsonWriter.)
Public methodWriteValue(NullableInt16) (Inherited from JsonWriter.)
Public methodWriteValue(NullableInt32) (Inherited from JsonWriter.)
Public methodWriteValue(NullableInt64) (Inherited from JsonWriter.)
Public methodWriteValue(NullableSByte) (Inherited from JsonWriter.)
Public methodWriteValue(NullableSingle) (Inherited from JsonWriter.)
Public methodWriteValue(NullableTimeSpan) (Inherited from JsonWriter.)
Public methodWriteValue(NullableUInt16) (Inherited from JsonWriter.)
Public methodWriteValue(NullableUInt32) (Inherited from JsonWriter.)
Public methodWriteValue(NullableUInt64) (Inherited from JsonWriter.)
Public methodWriteValue(Boolean)
Writes a Boolean value.
(Overrides JsonWriterWriteValue(Boolean).)
Public methodWriteValue(Byte)
Writes a Byte value.
(Overrides JsonWriterWriteValue(Byte).)
Public methodWriteValue(Byte)
Writes a Byte[] value.
(Overrides JsonWriterWriteValue(Byte).)
Public methodWriteValue(Char)
Writes a Char value.
(Overrides JsonWriterWriteValue(Char).)
Public methodWriteValue(DateTime)
Writes a DateTime value.
(Overrides JsonWriterWriteValue(DateTime).)
Public methodWriteValue(DateTimeOffset)
Writes a DateTimeOffset value.
(Overrides JsonWriterWriteValue(DateTimeOffset).)
Public methodWriteValue(Decimal)
Writes a Decimal value.
(Overrides JsonWriterWriteValue(Decimal).)
Public methodWriteValue(Double)
Writes a Double value.
(Overrides JsonWriterWriteValue(Double).)
Public methodWriteValue(Guid)
Writes a Guid value.
(Overrides JsonWriterWriteValue(Guid).)
Public methodWriteValue(Int16)
Writes a Int16 value.
(Overrides JsonWriterWriteValue(Int16).)
Public methodWriteValue(Int32)
Writes a Int32 value.
(Overrides JsonWriterWriteValue(Int32).)
Public methodWriteValue(Int64)
Writes a Int64 value.
(Overrides JsonWriterWriteValue(Int64).)
Public methodWriteValue(Object)
Writes a Object value. An error will raised if the value cannot be written as a single JSON token.
(Overrides JsonWriterWriteValue(Object).)
Public methodWriteValue(SByte)
Writes a SByte value.
(Overrides JsonWriterWriteValue(SByte).)
Public methodWriteValue(Single)
Writes a Single value.
(Overrides JsonWriterWriteValue(Single).)
Public methodWriteValue(String)
Writes a String value.
(Overrides JsonWriterWriteValue(String).)
Public methodWriteValue(TimeSpan)
Writes a TimeSpan value.
(Overrides JsonWriterWriteValue(TimeSpan).)
Public methodWriteValue(UInt16)
Writes a UInt16 value.
(Overrides JsonWriterWriteValue(UInt16).)
Public methodWriteValue(UInt32)
Writes a UInt32 value.
(Overrides JsonWriterWriteValue(UInt32).)
Public methodWriteValue(UInt64)
Writes a UInt64 value.
(Overrides JsonWriterWriteValue(UInt64).)
Public methodWriteValue(Uri)
Writes a Uri value.
(Overrides JsonWriterWriteValue(Uri).)
Protected methodWriteValueDelimiter
Writes the JSON value delimiter.
(Inherited from JsonWriter.)
Public methodWriteWhitespace
Writes out the given white space.
(Inherited from JsonWriter.)
Public propertyCloseOutput
Gets or sets a value indicating whether the underlying stream or TextReader should be closed when the writer is closed.
(Inherited from JsonWriter.)
Public propertyCulture
Gets or sets the culture used when writing JSON. Defaults to InvariantCulture.
(Inherited from JsonWriter.)
Public propertyDateFormatHandling
Get or set how dates are written to JSON text.
(Inherited from JsonWriter.)
Public propertyDateFormatString
Get or set how DateTime and DateTimeOffset values are formatting when writing JSON text.
(Inherited from JsonWriter.)
Public propertyDateTimeKindHandling
Gets or sets the DateTimeKind used when writing DateTime values to BSON. When set to Unspecified no conversion will occur.
Public propertyDateTimeZoneHandling
Get or set how DateTime time zones are handling when writing JSON text.
(Inherited from JsonWriter.)
Public propertyFloatFormatHandling
Get or set how special floating point numbers, e.g. NaN, PositiveInfinity and NegativeInfinity, are written to JSON text.
(Inherited from JsonWriter.)
Public propertyFormatting
Indicates how JSON text output is formatted.
(Inherited from JsonWriter.)
Public propertyPath
Gets the path of the writer.
(Inherited from JsonWriter.)
Public propertyStringEscapeHandling
Get or set how strings are escaped when writing JSON text.
(Inherited from JsonWriter.)
Protected propertyTop
Gets the top.
(Inherited from JsonWriter.)
Public propertyWriteState
Gets the state of the writer.
(Inherited from JsonWriter.)
See Also