Click or drag to resize
BitConverter Class
Converts base data types to an array of bytes, and an array of bytes to base data types.
Inheritance Hierarchy
SystemObject
  SystemBitConverter

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static class BitConverter

The BitConverter type exposes the following members.

Methods
  NameDescription
Public methodStatic memberGetBytes(Boolean)
Returns the specified Boolean value as an array of bytes.
Public methodStatic memberGetBytes(Char)
Returns the specified Unicode character value as an array of bytes.
Public methodStatic memberGetBytes(Double)
Returns the specified double-precision floating point value as an array of bytes.
Public methodStatic memberGetBytes(Int16)
Returns the specified 16-bit signed integer value as an array of bytes.
Public methodStatic memberGetBytes(Int32)
Returns the specified 32-bit signed integer value as an array of bytes.
Public methodStatic memberGetBytes(Int64)
Returns the specified 64-bit signed integer value as an array of bytes.
Public methodStatic memberGetBytes(Single)
Returns the specified single-precision floating point value as an array of bytes.
Public methodStatic memberGetBytes(UInt16)
Returns the specified 16-bit unsigned integer value as an array of bytes.
Public methodStatic memberGetBytes(UInt32)
Returns the specified 32-bit unsigned integer value as an array of bytes.
Public methodStatic memberGetBytes(UInt64)
Returns the specified 64-bit unsigned integer value as an array of bytes.
Public methodStatic memberToBoolean
Returns a Boolean value converted from one byte at a specified position in a byte array.
Public methodStatic memberToDouble
Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array.
Public methodStatic memberToInt16
Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.
Public methodStatic memberToInt32
Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.
Public methodStatic memberToInt64
Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.
Public methodStatic memberToSingle
Returns a single-precision floating point number converted from four bytes at a specified position in a byte array.
Public methodStatic memberToString(Byte)
Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation.
Public methodStatic memberToString(Byte, Int32)
Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation.
Public methodStatic memberToString(Byte, Int32, Int32)
Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation.
Public methodStatic memberToUInt16
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.
Public methodStatic memberToUInt32
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.
Public methodStatic memberToUInt64
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.
Top
Fields
  NameDescription
Public fieldStatic memberIsLittleEndian
Indicates the byte order ("endianness") in which data is stored in this computer architecture.
Top
See Also