Show / Hide Table of Contents

    Class JsonStreamConverter

    This utility class is designed to make JSON System.IO.Stream related conversions easier to work with.

    Inheritance
    System.Object
    JsonStreamConverter
    Namespace: Cuemon.IO
    Assembly: Cuemon.Xml.dll
    Syntax
    public static class JsonStreamConverter

    Methods

    | Improve this Doc

    FromXmlStream(Stream)

    Returns a UTF-8 encoded JSON representation of the specified XML stream and whose value is equivalent to the specified XML stream.

    Declaration
    public static Stream FromXmlStream(Stream value)
    Parameters
    Type Name Description
    System.IO.Stream value

    The XML to convert to a JSON representation.

    Returns
    Type Description
    System.IO.Stream

    A UTF-8 encoded JSON representation of the specified value and whose value is equivalent to value.

    Remarks

    The JSON representation is in compliance with RFC 4627. Take note, that all string values is escaped using Escape(String). This is by design and to help ensure compatibility with a wide range of data.

    | Improve this Doc

    FromXmlStream(Stream, Encoding)

    Returns a JSON representation of the specified XML stream and whose value is equivalent to the specified XML stream.

    Declaration
    public static Stream FromXmlStream(Stream value, Encoding encoding)
    Parameters
    Type Name Description
    System.IO.Stream value

    The XML to convert to a JSON representation.

    System.Text.Encoding encoding

    The text encoding to use.

    Returns
    Type Description
    System.IO.Stream

    A JSON representation of the specified value and whose value is equivalent to value.

    Remarks

    The JSON representation is in compliance with RFC 4627. Take note, that all string values is escaped using Escape(String). This is by design and to help ensure compatibility with a wide range of data.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    This exception is thrown when encoding is not within the boundaries of RFC 4627.

    System.ArgumentNullException

    This exception is thrown should either of value or encoding have the value of null.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX