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

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

The JsonTextWriter type exposes the following members.

Public methodJsonTextWriter
Creates an instance of the JsonWriter class using the specified TextWriter.
Public propertyArrayPool
Gets or sets the writer's character array pool.
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 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 propertyIndentation
Gets or sets how many IndentChars to write for each level in the hierarchy when Formatting is set to Formatting.Indented.
Public propertyIndentChar
Gets or sets which character to use for indenting when Formatting is set to Formatting.Indented.
Public propertyPath
Gets the path of the writer.
(Inherited from JsonWriter.)
Public propertyQuoteChar
Gets or sets which character to use to quote attribute values.
Public propertyQuoteName
Gets or sets a value indicating whether object names will be surrounded with quotes.
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.)
Public methodClose
Closes this stream and the underlying stream.
(Overrides JsonWriterClose.)
Protected methodDispose
Releases unmanaged and - optionally - managed resources
(Inherited from JsonWriter.)
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 specified end token.
(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.
(Overrides JsonWriterWriteIndent.)
Protected methodWriteIndentSpace
Writes an indent space.
(Overrides JsonWriterWriteIndentSpace.)
Public methodWriteNull
Writes a null value.
(Overrides JsonWriterWriteNull.)
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.
(Overrides JsonWriterWritePropertyName(String, Boolean).)
Public methodWriteRaw
Writes raw JSON.
(Overrides JsonWriterWriteRaw(String).)
Public methodWriteRawValue
Writes raw JSON where a value is expected and updates the writer's state.
(Inherited from JsonWriter.)
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(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(NullableDouble) (Overrides JsonWriterWriteValue(NullableDouble).)
Public methodWriteValue(NullableSingle) (Overrides JsonWriterWriteValue(NullableSingle).)
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).)
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(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(NullableTimeSpan) (Inherited from JsonWriter.)
Public methodWriteValue(NullableUInt16) (Inherited from JsonWriter.)
Public methodWriteValue(NullableUInt32) (Inherited from JsonWriter.)
Public methodWriteValue(NullableUInt64) (Inherited from JsonWriter.)
Protected methodWriteValueDelimiter
Writes the JSON value delimiter.
(Overrides JsonWriterWriteValueDelimiter.)
Public methodWriteWhitespace
Writes out the given white space.
(Overrides JsonWriterWriteWhitespace(String).)
See Also