Search Results for

    Show / Hide Table of Contents

    Class BinaryPrimitives

    Reads bytes as primitives with specific endianness.

    Inheritance
    Object
    BinaryPrimitives
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: System.Buffers.Binary
    Assembly: System.Buffers.Binary.BinaryPrimitives.dll
    Syntax
    public static class BinaryPrimitives

    Methods

    | Improve this Doc View Source

    ReadInt16BigEndian(SpanByte)

    Reads an System.Int16 from the beginning of a read-only span of bytes, as big endian.

    Declaration
    public static short ReadInt16BigEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Int16

    The big endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    ReadInt16LittleEndian(SpanByte)

    Reads an System.Int16 from the beginning of a read-only span of bytes, as little endian.

    Declaration
    public static short ReadInt16LittleEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Int16

    The little endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    ReadInt32BigEndian(SpanByte)

    Reads an System.Int32 from the beginning of a read-only span of bytes, as big endian.

    Declaration
    public static int ReadInt32BigEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Int32

    The big endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    ReadInt32LittleEndian(SpanByte)

    Reads an System.Int32 from the beginning of a read-only span of bytes, as little endian.

    Declaration
    public static int ReadInt32LittleEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Int32

    The little endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    ReadInt64BigEndian(SpanByte)

    Reads an System.Int64 from the beginning of a read-only span of bytes, as little endian.

    Declaration
    public static long ReadInt64BigEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Int64

    The little endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    | Improve this Doc View Source

    ReadInt64LittleEndian(SpanByte)

    Reads an System.Int64 from the beginning of a read-only span of bytes, as big endian.

    Declaration
    public static long ReadInt64LittleEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Int64

    The big endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    | Improve this Doc View Source

    ReadSingleBigEndian(SpanByte)

    Reads a Single from the beginning of a read-only span of bytes, as big endian.

    Declaration
    public static float ReadSingleBigEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Single

    The big endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain a Single.

    | Improve this Doc View Source

    ReadSingleLittleEndian(SpanByte)

    Reads a Single from the beginning of a read-only span of bytes, as little endian.

    Declaration
    public static float ReadSingleLittleEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    Single

    The little endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain a Single.

    | Improve this Doc View Source

    ReadUInt16BigEndian(SpanByte)

    Reads a System.UInt16 from the beginning of a read-only span of bytes, as big endian.

    Declaration
    public static ushort ReadUInt16BigEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    UInt16

    The big endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    ReadUInt16LittleEndian(SpanByte)

    Reads a System.UInt16 from the beginning of a read-only span of bytes, as little endian.

    Declaration
    public static ushort ReadUInt16LittleEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    UInt16

    The little endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    ReadUInt32BigEndian(SpanByte)

    Reads a System.UInt32 from the beginning of a read-only span of bytes, as big endian.

    Declaration
    public static uint ReadUInt32BigEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span to read.

    Returns
    Type Description
    UInt32

    The big endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    ReadUInt32LittleEndian(SpanByte)

    Reads a System.UInt32 from the beginning of a read-only span of bytes, as little endian.

    Declaration
    public static uint ReadUInt32LittleEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span of bytes to read.

    Returns
    Type Description
    UInt32

    The little endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    ReadUInt64BigEndian(SpanByte)

    Reads a System.UInt64 from the beginning of a read-only span of bytes, as big endian.

    Declaration
    public static ulong ReadUInt64BigEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span of bytes to read.

    Returns
    Type Description
    UInt64

    The big endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    | Improve this Doc View Source

    ReadUInt64LittleEndian(SpanByte)

    Reads a System.UInt64 from the beginning of a read-only span of bytes, as little endian.

    Declaration
    public static ulong ReadUInt64LittleEndian(SpanByte source)
    Parameters
    Type Name Description
    SpanByte source

    The read-only span of bytes to read.

    Returns
    Type Description
    UInt64

    The little endian value.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    | Improve this Doc View Source

    WriteInt16BigEndian(SpanByte, Int16)

    Writes an System.Int16 into a span of bytes, as big endian.

    Declaration
    public static void WriteInt16BigEndian(SpanByte destination, short value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as big endian.

    Int16 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    WriteInt16LittleEndian(SpanByte, Int16)

    Writes an System.Int16 into a span of bytes, as little endian.

    Declaration
    public static void WriteInt16LittleEndian(SpanByte destination, short value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as little endian.

    Int16 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    WriteInt32BigEndian(SpanByte, Int32)

    Writes an System.Int32 into a span of bytes, as big endian.

    Declaration
    public static void WriteInt32BigEndian(SpanByte destination, int value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as big endian.

    Int32 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    WriteInt32LittleEndian(SpanByte, Int32)

    Writes an System.Int32 into a span of bytes, as little endian.

    Declaration
    public static void WriteInt32LittleEndian(SpanByte destination, int value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as little endian.

    Int32 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    WriteInt64BigEndian(SpanByte, Int64)

    Writes an System.Int64 into a span of bytes, as big endian.

    Declaration
    public static void WriteInt64BigEndian(SpanByte destination, long value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as big endian.

    Int64 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    | Improve this Doc View Source

    WriteInt64LittleEndian(SpanByte, Int64)

    Writes an System.Int64 into a span of bytes, as little endian.

    Declaration
    public static void WriteInt64LittleEndian(SpanByte destination, long value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as little endian.

    Int64 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    | Improve this Doc View Source

    WriteSingleBigEndian(SpanByte, Single)

    Writes a Single into a span of bytes, as big endian.

    Declaration
    public static void WriteSingleBigEndian(SpanByte destination, float value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as big endian.

    Single value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Destination is too small to contain a Single.

    | Improve this Doc View Source

    WriteSingleLittleEndian(SpanByte, Single)

    Writes a Single into a span of bytes, as little endian.

    Declaration
    public static void WriteSingleLittleEndian(SpanByte destination, float value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as little endian.

    Single value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Destination is too small to contain a Single.

    | Improve this Doc View Source

    WriteUInt16BigEndian(SpanByte, UInt16)

    Writes a System.UInt16 into a span of bytes, as big endian.

    Declaration
    public static void WriteUInt16BigEndian(SpanByte destination, ushort value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as big endian.

    UInt16 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    WriteUInt16LittleEndian(SpanByte, UInt16)

    Writes a System.UInt16 into a span of bytes, as little endian.

    Declaration
    public static void WriteUInt16LittleEndian(SpanByte destination, ushort value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as little endian.

    UInt16 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int16.

    | Improve this Doc View Source

    WriteUInt32BigEndian(SpanByte, UInt32)

    Writes a System.UInt32 into a span of bytes, as big endian.

    Declaration
    public static void WriteUInt32BigEndian(SpanByte destination, uint value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as big endian.

    UInt32 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    WriteUInt32LittleEndian(SpanByte, UInt32)

    Writes a System.UInt32 into a span of bytes, as little endian.

    Declaration
    public static void WriteUInt32LittleEndian(SpanByte destination, uint value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as little endian.

    UInt32 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int32.

    | Improve this Doc View Source

    WriteUInt64BigEndian(SpanByte, UInt64)

    Writes a System.UInt64 into a span of bytes, as big endian.

    Declaration
    public static void WriteUInt64BigEndian(SpanByte destination, ulong value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as big endian.

    UInt64 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    | Improve this Doc View Source

    WriteUInt64LittleEndian(SpanByte, UInt64)

    Writes a System.UInt64 into a span of bytes, as little endian.

    Declaration
    public static void WriteUInt64LittleEndian(SpanByte destination, ulong value)
    Parameters
    Type Name Description
    SpanByte destination

    The span of bytes where the value is to be written, as little endian.

    UInt64 value

    The value to write into the span of bytes.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Source is too small to contain an System.Int64.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX