mscorlib(4.0.0.0) API with additions
|
Converts base data types to an array of bytes, and an array of bytes to base data types. More...
Static Public Member Functions | |
static byte [] | GetBytes (bool value) |
Returns the specified Boolean value as a byte array. More... | |
static byte [] | GetBytes (char value) |
Returns the specified Unicode character value as an array of bytes. More... | |
static unsafe byte [] | GetBytes (short value) |
Returns the specified 16-bit signed integer value as an array of bytes. More... | |
static unsafe byte [] | GetBytes (int value) |
Returns the specified 32-bit signed integer value as an array of bytes. More... | |
static unsafe byte [] | GetBytes (long value) |
Returns the specified 64-bit signed integer value as an array of bytes. More... | |
static byte [] | GetBytes (ushort value) |
Returns the specified 16-bit unsigned integer value as an array of bytes. More... | |
static byte [] | GetBytes (uint value) |
Returns the specified 32-bit unsigned integer value as an array of bytes. More... | |
static byte [] | GetBytes (ulong value) |
Returns the specified 64-bit unsigned integer value as an array of bytes. More... | |
static unsafe byte [] | GetBytes (float value) |
Returns the specified single-precision floating point value as an array of bytes. More... | |
static unsafe byte [] | GetBytes (double value) |
Returns the specified double-precision floating point value as an array of bytes. More... | |
static char | ToChar (byte[] value, int startIndex) |
Returns a Unicode character converted from two bytes at a specified position in a byte array. More... | |
static unsafe short | ToInt16 (byte[] value, int startIndex) |
Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array. More... | |
static unsafe int | ToInt32 (byte[] value, int startIndex) |
Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array. More... | |
static unsafe long | ToInt64 (byte[] value, int startIndex) |
Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array. More... | |
static ushort | ToUInt16 (byte[] value, int startIndex) |
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array. More... | |
static uint | ToUInt32 (byte[] value, int startIndex) |
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array. More... | |
static ulong | ToUInt64 (byte[] value, int startIndex) |
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array. More... | |
static unsafe float | ToSingle (byte[] value, int startIndex) |
Returns a single-precision floating point number converted from four bytes at a specified position in a byte array. More... | |
static unsafe double | ToDouble (byte[] value, int startIndex) |
Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array. More... | |
static string | ToString (byte[] value, int startIndex, int length) |
Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation. More... | |
static string | ToString (byte[] value) |
Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation. More... | |
static string | ToString (byte[] value, int startIndex) |
Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation. More... | |
static bool | ToBoolean (byte[] value, int startIndex) |
Returns a Boolean value converted from the byte at a specified position in a byte array. More... | |
static unsafe long | DoubleToInt64Bits (double value) |
Converts the specified double-precision floating point number to a 64-bit signed integer. More... | |
static unsafe double | Int64BitsToDouble (long value) |
Converts the specified 64-bit signed integer to a double-precision floating point number. More... | |
Static Public Attributes | |
static readonly bool | IsLittleEndian = true |
Indicates the byte order ("endianness") in which data is stored in this computer architecture. More... | |
Converts base data types to an array of bytes, and an array of bytes to base data types.
Definition at line 7 of file BitConverter.cs.
|
static |
Converts the specified double-precision floating point number to a 64-bit signed integer.
value | The number to convert. |
Definition at line 563 of file BitConverter.cs.
|
static |
Returns the specified Boolean value as a byte array.
value | A Boolean value. |
Definition at line 19 of file BitConverter.cs.
|
static |
Returns the specified Unicode character value as an array of bytes.
value | A character to convert. |
Definition at line 31 of file BitConverter.cs.
|
static |
Returns the specified 16-bit signed integer value as an array of bytes.
value | The number to convert. |
Definition at line 41 of file BitConverter.cs.
|
static |
Returns the specified 32-bit signed integer value as an array of bytes.
value | The number to convert. |
Definition at line 57 of file BitConverter.cs.
|
static |
Returns the specified 64-bit signed integer value as an array of bytes.
value | The number to convert. |
Definition at line 73 of file BitConverter.cs.
|
static |
Returns the specified 16-bit unsigned integer value as an array of bytes.
value | The number to convert. |
Definition at line 89 of file BitConverter.cs.
|
static |
Returns the specified 32-bit unsigned integer value as an array of bytes.
value | The number to convert. |
Definition at line 99 of file BitConverter.cs.
|
static |
Returns the specified 64-bit unsigned integer value as an array of bytes.
value | The number to convert. |
Definition at line 109 of file BitConverter.cs.
|
static |
Returns the specified single-precision floating point value as an array of bytes.
value | The number to convert. |
Definition at line 119 of file BitConverter.cs.
|
static |
Returns the specified double-precision floating point value as an array of bytes.
value | The number to convert. |
Definition at line 129 of file BitConverter.cs.
|
static |
Converts the specified 64-bit signed integer to a double-precision floating point number.
value | The number to convert. |
Definition at line 573 of file BitConverter.cs.
|
static |
Returns a Boolean value converted from the byte at a specified position in a byte array.
value | A byte array. |
startIndex | The index of the byte within value . |
true
if the byte at startIndex in value is nonzero; otherwise, false
.T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 537 of file BitConverter.cs.
|
static |
Returns a Unicode character converted from two bytes at a specified position in a byte array.
value | An array. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex equals the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 145 of file BitConverter.cs.
|
static |
Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex is greater than or equal to the length of value minus 7, and is less than or equal to the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 415 of file BitConverter.cs.
|
static |
Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex equals the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 174 of file BitConverter.cs.
|
static |
Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex is greater than or equal to the length of value minus 3, and is less than or equal to the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 214 of file BitConverter.cs.
|
static |
Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex is greater than or equal to the length of value minus 7, and is less than or equal to the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 254 of file BitConverter.cs.
|
static |
Returns a single-precision floating point number converted from four bytes at a specified position in a byte array.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex is greater than or equal to the length of value minus 3, and is less than or equal to the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 385 of file BitConverter.cs.
|
static |
Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation.
value | An array of bytes. |
startIndex | The starting position within value . |
length | The number of array elements in value to convert. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex or length is less than zero.-or- startIndex is greater than zero and is greater than or equal to the length of value . |
T:System.ArgumentException | The combination of startIndex and length does not specify a position within value ; that is, the startIndex parameter is greater than the length of value minus the length parameter. |
Definition at line 454 of file BitConverter.cs.
|
static |
Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation.
value | An array of bytes. |
T:System.ArgumentNullException | value is null . |
Definition at line 500 of file BitConverter.cs.
|
static |
Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 518 of file BitConverter.cs.
|
static |
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.
value | The array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex equals the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 298 of file BitConverter.cs.
|
static |
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex is greater than or equal to the length of value minus 3, and is less than or equal to the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 327 of file BitConverter.cs.
|
static |
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.
value | An array of bytes. |
startIndex | The starting position within value . |
T:System.ArgumentException | startIndex is greater than or equal to the length of value minus 7, and is less than or equal to the length of value minus 1. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of value minus 1. |
Definition at line 356 of file BitConverter.cs.
|
static |
Indicates the byte order ("endianness") in which data is stored in this computer architecture.
true
if the architecture is little-endian; false
if it is big-endian. Definition at line 13 of file BitConverter.cs.