Show / Hide Table of Contents

    Class JsonWriter

    Represents a writer that provides a fast, non-cached, forward-only means of generating streams or files containing JSON data.

    Inheritance
    System.Object
    JsonWriter
    Implements
    System.IDisposable
    Namespace: Cuemon.Runtime.Serialization
    Assembly: Cuemon.Runtime.dll
    Syntax
    public abstract class JsonWriter : IDisposable

    Constructors

    | Improve this Doc

    JsonWriter(Stream)

    Initializes a new instance of the JsonWriter class.

    Declaration
    protected JsonWriter(Stream output)
    Parameters
    Type Name Description
    System.IO.Stream output

    The System.IO.Stream to which you want to write.

    | Improve this Doc

    JsonWriter(Stream, Encoding)

    Initializes a new instance of the JsonWriter class.

    Declaration
    protected JsonWriter(Stream output, Encoding encoding)
    Parameters
    Type Name Description
    System.IO.Stream output

    The System.IO.Stream to which you want to write.

    System.Text.Encoding encoding

    The character encoding to use in the generated output.

    Fields

    | Improve this Doc

    BeginArray

    Represents the begin-array character as defined in RFC 4627.

    Declaration
    public static readonly string BeginArray
    Field Value
    Type Description
    System.String
    | Improve this Doc

    BeginObject

    Represents the begin-object character as defined in RFC 4627.

    Declaration
    public static readonly string BeginObject
    Field Value
    Type Description
    System.String
    | Improve this Doc

    EndArray

    Represents the end-array character as defined in RFC 4627.

    Declaration
    public static readonly string EndArray
    Field Value
    Type Description
    System.String
    | Improve this Doc

    EndObject

    Represents the end-object character as defined in RFC 4627.

    Declaration
    public static readonly string EndObject
    Field Value
    Type Description
    System.String
    | Improve this Doc

    NameSeperator

    Represents the name-seperator character as defined in RFC 4627.

    Declaration
    public static readonly string NameSeperator
    Field Value
    Type Description
    System.String
    | Improve this Doc

    ValueSeperator

    Represents the value-seperator character as defined in RFC 4627.

    Declaration
    public static readonly string ValueSeperator
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc

    Encoding

    Gets the character encoding used by this instance of the JsonWriter.

    Declaration
    public Encoding Encoding { get; }
    Property Value
    Type Description
    System.Text.Encoding
    | Improve this Doc

    IsDisposed

    Gets a value indicating whether this instance is disposed.

    Declaration
    protected bool IsDisposed { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is disposed; otherwise, false.

    Methods

    | Improve this Doc

    Create(Stream)

    Creates a new JsonWriter instance using the specified stream.

    Declaration
    public static JsonWriter Create(Stream output)
    Parameters
    Type Name Description
    System.IO.Stream output

    The System.IO.Stream to which you want to write.

    Returns
    Type Description
    JsonWriter

    An JsonWriter object.

    | Improve this Doc

    Create(Stream, Encoding)

    Creates a new JsonWriter instance using the specified stream.

    Declaration
    public static JsonWriter Create(Stream output, Encoding encoding)
    Parameters
    Type Name Description
    System.IO.Stream output

    The System.IO.Stream to which you want to write.

    System.Text.Encoding encoding

    The character encoding to use in the generated output.

    Returns
    Type Description
    JsonWriter

    An JsonWriter object.

    | Improve this Doc

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Improve this Doc

    Dispose(Boolean)

    Releases unmanaged and - optionally - managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    | Improve this Doc

    Flush()

    Clears all buffers for the current writer and causes any buffered data to be written to the underlying stream.

    Declaration
    public void Flush()
    | Improve this Doc

    ValidateEncoding(Encoding)

    Validates the specified encoding according to RFC 4627.

    Declaration
    public static void ValidateEncoding(Encoding encoding)
    Parameters
    Type Name Description
    System.Text.Encoding encoding

    The character encoding to validate.

    Exceptions
    Type Condition
    System.ArgumentNullException

    encoding is null.

    System.ArgumentOutOfRangeException

    encoding is not within the allowed range of allowed encoding values.

    | Improve this Doc

    WriteComment(String)

    Writes out a comment

    /.../
    containing the specified text.

    Declaration
    public void WriteComment(string text)
    Parameters
    Type Name Description
    System.String text

    Text to place inside the comment.

    | Improve this Doc

    WriteEndArray()

    Writes the EndArray tag of a JSON array.

    Declaration
    public void WriteEndArray()
    | Improve this Doc

    WriteEndObject()

    Writes the EndObject tag of a JSON object.

    Declaration
    public void WriteEndObject()
    | Improve this Doc

    WriteObject(String)

    Writes a JSON object with no value associated.

    Declaration
    public void WriteObject(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    | Improve this Doc

    WriteObject(String, Boolean)

    Writes a boolean JSON object.

    Declaration
    public void WriteObject(string name, bool value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Boolean value

    The System.Boolean value of the JSON object.

    | Improve this Doc

    WriteObject(String, Byte)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, byte value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Byte value

    The System.Byte value of the JSON object.

    | Improve this Doc

    WriteObject(String, Byte[])

    Writes a base64 encoded string JSON object.

    Declaration
    public void WriteObject(string name, byte[] value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Byte[] value

    The binary value of the JSON object.

    | Improve this Doc

    WriteObject(String, Char)

    Writes a string JSON object.

    Declaration
    public void WriteObject(string name, char value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Char value

    The System.Char value of the JSON object.

    | Improve this Doc

    WriteObject(String, DateTime)

    Writes a string JSON object.

    Declaration
    public void WriteObject(string name, DateTime value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.DateTime value

    The System.DateTime value of the JSON object.

    | Improve this Doc

    WriteObject(String, Decimal)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, decimal value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Decimal value

    The System.Decimal value of the JSON object.

    | Improve this Doc

    WriteObject(String, Double)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, double value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Double value

    The System.Double value of the JSON object.

    | Improve this Doc

    WriteObject(String, Guid)

    Writes a string JSON object.

    Declaration
    public void WriteObject(string name, Guid value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Guid value

    The System.Guid value of the JSON object.

    | Improve this Doc

    WriteObject(String, Int16)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, short value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Int16 value

    The System.Int16 value of the JSON object.

    | Improve this Doc

    WriteObject(String, Int32)

    Writes a string JSON object.

    Declaration
    public void WriteObject(string name, int value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Int32 value

    The System.Int32 value of the JSON object.

    | Improve this Doc

    WriteObject(String, Int64)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, long value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Int64 value

    The System.Int64 value of the JSON object.

    | Improve this Doc

    WriteObject(String, Object)

    Writes a JSON object.

    Declaration
    public void WriteObject(string name, object value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Object value

    The value of the JSON object.

    | Improve this Doc

    WriteObject(String, SByte)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, sbyte value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.SByte value

    The System.SByte value of the JSON object.

    | Improve this Doc

    WriteObject(String, Single)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, float value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.Single value

    The System.Single value of the JSON object.

    | Improve this Doc

    WriteObject(String, String)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, string value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.String value

    The System.String value of the JSON object.

    | Improve this Doc

    WriteObject(String, UInt16)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, ushort value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.UInt16 value

    The System.UInt16 value of the JSON object.

    | Improve this Doc

    WriteObject(String, UInt32)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, uint value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.UInt32 value

    The System.UInt32 value of the JSON object.

    | Improve this Doc

    WriteObject(String, UInt64)

    Writes a numeric JSON object.

    Declaration
    public void WriteObject(string name, ulong value)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    System.UInt64 value

    The System.UInt64 value of the JSON object.

    | Improve this Doc

    WriteObjectName(String)

    Writes the name of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectName(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the JSON object.

    | Improve this Doc

    WriteObjectValue(Boolean)

    Writes the boolean value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(bool value)
    Parameters
    Type Name Description
    System.Boolean value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Byte)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(byte value)
    Parameters
    Type Name Description
    System.Byte value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Byte[])

    Writes the string value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(byte[] value)
    Parameters
    Type Name Description
    System.Byte[] value

    The value of the JSON object.

    Remarks

    value is converted to a Base64 encoded string.

    | Improve this Doc

    WriteObjectValue(Char)

    Writes the string value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(char value)
    Parameters
    Type Name Description
    System.Char value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(DateTime)

    Writes the string value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(DateTime value)
    Parameters
    Type Name Description
    System.DateTime value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Decimal)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(decimal value)
    Parameters
    Type Name Description
    System.Decimal value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Double)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(double value)
    Parameters
    Type Name Description
    System.Double value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Guid)

    Writes the string value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(Guid value)
    Parameters
    Type Name Description
    System.Guid value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Int16)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(short value)
    Parameters
    Type Name Description
    System.Int16 value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Int32)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(int value)
    Parameters
    Type Name Description
    System.Int32 value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Int64)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(long value)
    Parameters
    Type Name Description
    System.Int64 value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Object)

    Writes the value of a JSON object.

    Declaration
    public void WriteObjectValue(object value)
    Parameters
    Type Name Description
    System.Object value

    The value of the JSON object.

    Remarks

    value is checked and written accordingly by the System.IConvertible interface.

    | Improve this Doc

    WriteObjectValue(SByte)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(sbyte value)
    Parameters
    Type Name Description
    System.SByte value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(Single)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(float value)
    Parameters
    Type Name Description
    System.Single value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(String)

    Writes the string value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(string value)
    Parameters
    Type Name Description
    System.String value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(UInt16)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(ushort value)
    Parameters
    Type Name Description
    System.UInt16 value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(UInt32)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(uint value)
    Parameters
    Type Name Description
    System.UInt32 value

    The value of the JSON object.

    | Improve this Doc

    WriteObjectValue(UInt64)

    Writes the numeric value of a JSON object as defined in RFC 4627.

    Declaration
    public void WriteObjectValue(ulong value)
    Parameters
    Type Name Description
    System.UInt64 value

    The value of the JSON object.

    | Improve this Doc

    WriteRaw(String)

    Writes the raw JSON manually from a string.

    Declaration
    public void WriteRaw(string data)
    Parameters
    Type Name Description
    System.String data

    String containing the text to write.

    | Improve this Doc

    WriteStartArray()

    Writes the BeginArray tag of a JSON array.

    Declaration
    public void WriteStartArray()
    | Improve this Doc

    WriteStartObject()

    Writes the BeginObject tag of a JSON object.

    Declaration
    public void WriteStartObject()
    | Improve this Doc

    WriteValueSeperator()

    Writes the ValueSeperator.

    Declaration
    public void WriteValueSeperator()

    Implements

    System.IDisposable

    Extension Methods

    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX