Class ListOfByteExtensions
Extension methods for
Inheritance
Namespace: X10D.IO
Assembly: X10D.dll
Syntax
public static class ListOfByteExtensions : object
Methods
| Improve this Doc View SourceAsString(IReadOnlyList<Byte>)
Converts the numeric value of each element of a specified list of bytes to its equivalent hexadecimal string representation.
Declaration
public static string AsString(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.String | A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in
|
ToDouble(IReadOnlyList<Byte>)
Returns a double-precision floating point number converted from eight bytes.
Declaration
public static double ToDouble(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.Double | A double-precision floating point number formed by eight bytes. |
ToDouble(IReadOnlyList<Byte>, Int32)
Returns a double-precision floating point number converted from eight bytes at a specified position in a list of bytes.
Declaration
public static double ToDouble(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.Double | A double-precision floating point number formed by eight bytes beginning at |
ToInt16(IReadOnlyList<Byte>)
Returns a 16-bit signed integer converted from two bytes.
Declaration
public static short ToInt16(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.Int16 | A 16-bit signed integer formed by two bytes. |
ToInt16(IReadOnlyList<Byte>, Int32)
Returns a 16-bit signed integer converted from two bytes at a specified position in a list of bytes.
Declaration
public static short ToInt16(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.Int16 | A 16-bit signed integer formed by two bytes beginning at |
ToInt32(IReadOnlyList<Byte>)
Returns a 32-bit signed integer converted from four bytes.
Declaration
public static int ToInt32(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer formed by four bytes. |
ToInt32(IReadOnlyList<Byte>, Int32)
Returns a 32-bit signed integer converted from four bytes at a specified position in a list of bytes.
Declaration
public static int ToInt32(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer formed by four bytes beginning at |
ToInt64(IReadOnlyList<Byte>)
Returns a 64-bit signed integer converted from eight bytes.
Declaration
public static long ToInt64(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.Int64 | A 64-bit signed integer formed by eight bytes. |
ToInt64(IReadOnlyList<Byte>, Int32)
Returns a 64-bit signed integer converted from eight bytes at a specified position in a list of bytes.
Declaration
public static long ToInt64(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.Int64 | A 64-bit signed integer formed by eight bytes beginning at |
ToSingle(IReadOnlyList<Byte>)
Returns a single-precision floating point number converted from four bytes.
Declaration
public static float ToSingle(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.Single | A single-precision floating point number formed by four bytes. |
ToSingle(IReadOnlyList<Byte>, Int32)
Returns a single-precision floating point number converted from four bytes at a specified position in a list of bytes.
Declaration
public static float ToSingle(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.Single | A single-precision floating point number formed by four bytes beginning at |
ToString(IReadOnlyList<Byte>, Encoding)
Decodes all the bytes within the current list of bytes to a string, using a specified encoding.
Declaration
public static string ToString(this IReadOnlyList<byte> source, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Encoding | encoding | The encoding which should be used to decode |
Returns
Type | Description |
---|---|
System.String | A string that contains the results of decoding the specified sequence of bytes. |
ToUInt16(IReadOnlyList<Byte>)
Returns a 16-bit unsigned integer converted from two bytes.
Declaration
public static ushort ToUInt16(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.UInt16 | A 16-bit unsigned integer formed by two bytes. |
ToUInt16(IReadOnlyList<Byte>, Int32)
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a list of bytes.
Declaration
public static ushort ToUInt16(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.UInt16 | A 16-bit unsigned integer formed by two bytes beginning at |
ToUInt32(IReadOnlyList<Byte>)
Returns a 32-bit unsigned integer converted from four bytes.
Declaration
public static uint ToUInt32(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.UInt32 | A 32-bit unsigned integer formed by four bytes. |
ToUInt32(IReadOnlyList<Byte>, Int32)
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a list of bytes.
Declaration
public static uint ToUInt32(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.UInt32 | A 32-bit unsigned integer formed by four bytes beginning at |
ToUInt64(IReadOnlyList<Byte>)
Returns a 64-bit unsigned integer converted from eight bytes.
Declaration
public static ulong ToUInt64(this IReadOnlyList<byte> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
Returns
Type | Description |
---|---|
System.UInt64 | A 64-bit unsigned integer formed by eight bytes. |
ToUInt64(IReadOnlyList<Byte>, Int32)
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a list of bytes.
Declaration
public static ulong ToUInt64(this IReadOnlyList<byte> source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<System.Byte> | source | The source list of bytes. |
System.Int32 | startIndex | The starting position within |
Returns
Type | Description |
---|---|
System.UInt64 | A 64-bit unsigned integer formed by eight bytes beginning at |