Show / Hide Table of Contents

    Class ByteConverterExtensions

    This is an extension implementation of the ByteConverter class.

    Inheritance
    System.Object
    ByteConverterExtensions
    Namespace: Cuemon
    Assembly: Cuemon.Core.dll
    Syntax
    public static class ByteConverterExtensions

    Methods

    | Improve this Doc

    FromUrlEncodedBase64(String)

    Decodes a URL string token to its equivalent byte array using base 64 digits.

    Declaration
    public static byte[] FromUrlEncodedBase64(this string value)
    Parameters
    Type Name Description
    System.String value

    The URL string token to decode.

    Returns
    Type Description
    System.Byte[]

    The byte array containing the decoded URL string token.

    | Improve this Doc

    ToByteArray(Stream)

    Converts the specified value to a byte array always starting from position 0 (when supported).

    Declaration
    public static byte[] ToByteArray(this Stream value)
    Parameters
    Type Name Description
    System.IO.Stream value

    The System.IO.Stream value to be converted.

    Returns
    Type Description
    System.Byte[]

    A byte array containing the data from the stream.

    | Improve this Doc

    ToByteArray(Stream, Boolean)

    Converts the specified value to a byte array.

    Declaration
    public static byte[] ToByteArray(this Stream value, bool leaveStreamOpen)
    Parameters
    Type Name Description
    System.IO.Stream value

    The System.IO.Stream value to be converted.

    System.Boolean leaveStreamOpen

    if true, the System.IO.Stream object is being left open; otherwise it is being closed and disposed.

    Returns
    Type Description
    System.Byte[]

    A byte array containing the data from the stream.

    | Improve this Doc

    ToByteArray(String)

    Converts the specified value to a byte array using DefaultEncoding for the encoding and DefaultPreambleSequence for any preamble sequences.

    Declaration
    public static byte[] ToByteArray(this string value)
    Parameters
    Type Name Description
    System.String value

    The string to be converted.

    Returns
    Type Description
    System.Byte[]

    A byte array containing the results of encoding the specified set of characters.

    | Improve this Doc

    ToByteArray(String, Action<EncodingOptions>)

    Converts the specified value to a byte array using the provided preferred encoding.

    Declaration
    public static byte[] ToByteArray(this string value, Action<EncodingOptions> setup)
    Parameters
    Type Name Description
    System.String value

    The string to be converted.

    System.Action<EncodingOptions> setup

    The EncodingOptions which need to be configured.

    Returns
    Type Description
    System.Byte[]

    A byte array containing the results of encoding the specified set of characters.

    Remarks

    EncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.

    | Improve this Doc

    ToByteArray<T>(T)

    Converts the specified value to an array of bytes.

    Declaration
    public static byte[] ToByteArray<T>(this T value)
        where T : struct, IConvertible
    Parameters
    Type Name Description
    T value

    The System.IConvertible value to convert.

    Returns
    Type Description
    System.Byte[]

    An array of bytes equivalent to the data of the value.

    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    value is outside the range of allowed types.
    Allowed types are: System.Boolean, System.Char, System.Double, System.Int16, System.Int32, System.UInt16, System.UInt32 and System.UInt64.

    | Improve this Doc

    ToByteArray<T>(IEnumerable<T>)

    Converts the specified sequence of values to an array of bytes.

    Declaration
    public static byte[] ToByteArray<T>(this IEnumerable<T> values)
        where T : struct, IConvertible
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> values

    A sequence of System.IConvertible values to convert.

    Returns
    Type Description
    System.Byte[]

    An array of bytes equivalent to the sequence of the values.

    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    values is outside the range of allowed types.
    Allowed types are: System.Boolean, System.Char, System.Double, System.Int16, System.Int32, System.UInt16, System.UInt32 and System.UInt64.

    System.ArgumentNullException

    values is null.

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