Converts base data types to an std::vector of bytes, and an std::vector of bytes to base data types.
Little-endian | D2-02-96-49 |
Big-endian | 49-96-02-D2 |
Public Types | |
enum class | endian { little , big } |
Represents the xtd::byte order ("endianness") in which data is stored in this computer architecture. More... | |
Public Fields | |
static constexpr bool | is_big_endian |
Indicates the xtd::byte order ("endianness") in which data is stored in this computer architecture. | |
static constexpr bool | is_little_endian |
Indicates the xtd::byte order ("endianness") in which data is stored in this computer architecture. | |
static constexpr endian | endianness |
Indicates the xtd::byte order ("endianness") in which data is stored in this computer architecture. | |
Public Static Methods | |
static int64 | double_to_int64_bits (double value) noexcept |
Converts the specified double-precision floating point number to a 64-bit signed integer. | |
static std::vector< xtd::byte > | get_bytes (bool value) noexcept |
Returns the specified Boolean value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (char value) noexcept |
Returns the specified Char value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (char16 value) noexcept |
Returns the specified Char value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (char32 value) noexcept |
Returns the specified Char value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (wchar value) noexcept |
Returns the specified Char value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (double value) noexcept |
Returns the specified double value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (sbyte value) noexcept |
Returns the specified xtd::byte value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (int16 value) noexcept |
Returns the specified int16 value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (int32 value) noexcept |
Returns the specified int32 value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (int64 value) noexcept |
Returns the specified int64 value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (float value) noexcept |
Returns the specified single value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (xtd::byte value) noexcept |
Returns the specified xtd::byte value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (uint16 value) noexcept |
Returns the specified uint16 value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (uint32 value) noexcept |
Returns the specified uint32 value as an std::vector of bytes. | |
static std::vector< xtd::byte > | get_bytes (uint64 value) noexcept |
Returns the specified uint64 value as an std::vector of bytes. | |
static float | int32_bits_to_single (int32 value) noexcept |
Converts the specified 32-bit signed integer to a single-precision floating point number. | |
static double | int64_bits_to_double (int64 value) noexcept |
Converts the specified 64-bit signed integer to a double-precision floating point number. | |
static int32 | single_to_int32_bits (float value) noexcept |
Converts the specified single-precision floating point number to a 32-bit signed integer. | |
static bool | to_boolean (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a Boolean value converted from one xtd::byte at a specified position in a xtd::byte std::vector. | |
static char32 | to_char (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a char32 converted from two bytes at a specified position in a xtd::byte std::vector. | |
static double | to_double (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a double-precision floating point number converted from eight bytes at a specified position in a xtd::byte std::vector. | |
static int16 | to_int16 (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a 16-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector. | |
static int32 | to_int32 (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a 32-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector. | |
static int64 | to_int64 (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a 64-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector. | |
static float | to_single (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a single-precision floating point number converted from eight bytes at a specified position in a xtd::byte std::vector. | |
static uint16 | to_uint16 (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a xtd::byte std::vector. | |
static uint32 | to_uint32 (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a 32-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector. | |
static uint64 | to_uint64 (const std::vector< xtd::byte > &value, size_t start_index) |
Returns a 64-bit unsigned integer converted from two bytes at a specified position in a xtd::byte std::vector. | |
static xtd::string | to_string (const std::vector< xtd::byte > &value) |
Converts the numeric value of each element of a specified std::vector of bytes to its equivalent hexadecimal xtd::string representation. | |
static xtd::string | to_string (const std::vector< xtd::byte > &value, size_t start_index) |
Converts the numeric value of each element of a specified sub std::vector of bytes to its equivalent hexadecimal xtd::string representation. | |
static xtd::string | to_string (const std::vector< xtd::byte > &value, size_t start_index, size_t length) |
Converts the numeric value of each element of a specified sub std::vector of bytes to its equivalent hexadecimal xtd::string representation. | |
|
strong |
Represents the xtd::byte order ("endianness") in which data is stored in this computer architecture.
Enumerator | |
---|---|
little | Represnets "Little-endian" order. |
big | Represnets "Big-endian" order. |
|
staticnoexcept |
Converts the specified double-precision floating point number to a 64-bit signed integer.
value | The number to convert. |
|
staticnoexcept |
Returns the specified Boolean value as an std::vector of bytes.
value | A Boolean value. |
|
staticnoexcept |
Returns the specified Char value as an std::vector of bytes.
value | A Char value. |
Returns the specified Char value as an std::vector of bytes.
value | A Char value. |
Returns the specified Char value as an std::vector of bytes.
value | A Char value. |
Returns the specified Char value as an std::vector of bytes.
value | A Char value. |
|
staticnoexcept |
Returns the specified double value as an std::vector of bytes.
value | A double value. |
Returns the specified int16 value as an std::vector of bytes.
value | A int16 value. |
Returns the specified int32 value as an std::vector of bytes.
value | A int32 value. |
Returns the specified int64 value as an std::vector of bytes.
value | A int64 value. |
|
staticnoexcept |
Returns the specified single value as an std::vector of bytes.
value | A single value. |
Returns the specified uint16 value as an std::vector of bytes.
value | A uint16 value. |
Returns the specified uint32 value as an std::vector of bytes.
value | A uint32 value. |
Returns the specified uint64 value as an std::vector of bytes.
value | A uint64 value. |
|
staticnoexcept |
Converts the specified 32-bit signed integer to a single-precision floating point number.
value | The number to convert. |
|
staticnoexcept |
Converts the specified 64-bit signed integer to a double-precision floating point number.
value | The number to convert. |
|
staticnoexcept |
Converts the specified single-precision floating point number to a 32-bit signed integer.
value | The number to convert. |
|
static |
Returns a Boolean value converted from one xtd::byte at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a char32 converted from two bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a double-precision floating point number converted from eight bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a 16-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a 32-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a 64-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a single-precision floating point number converted from eight bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a 32-bit signed integer converted from two bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Returns a 64-bit unsigned integer converted from two bytes at a specified position in a xtd::byte std::vector.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_exception | start_index equals the length of value minus 1. |
argument_null_exception | value is null |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Converts the numeric value of each element of a specified std::vector of bytes to its equivalent hexadecimal xtd::string representation.
value | An std::vector of bytes. |
argument_null_exception | value is null. |
|
static |
Converts the numeric value of each element of a specified sub std::vector of bytes to its equivalent hexadecimal xtd::string representation.
value | An std::vector of bytes. |
start_index | The starting position within value. |
argument_null_exception | value is null. |
argument_out_of_range_exception | start_index is less than zero or greater than the length of value minus 1. |
|
static |
Converts the numeric value of each element of a specified sub std::vector of bytes to its equivalent hexadecimal xtd::string representation.
value | An std::vector of bytes. |
start_index | The starting position within value. |
length | The number of std::vector elements in value to convert. |
argument_null_exception | value is null. |
argument_out_of_range_exception | start_index or length is less than zero. -or- start_index is greater than zero and is greater than or equal to the length of value. |
argument_exception | The combination of start_index and length does not specify a position within value; that is, the start_index parameter is greater than the length of value minus the length parameter. |
|
staticconstexpr |
Indicates the xtd::byte order ("endianness") in which data is stored in this computer architecture.
|
staticconstexpr |
Indicates the xtd::byte order ("endianness") in which data is stored in this computer architecture.
|
staticconstexpr |
Indicates the xtd::byte order ("endianness") in which data is stored in this computer architecture.