Name

BitConverter

Synopsis

This class provides shared methods that can be used to convert portions of a byte array to simple value types. It also contains the overloaded GetBytes() method, which converts simple data types to byte arrays. These functions can be useful for creating custom reader and writer classes. For example, a typical writer class might take specific data, convert it to a byte array, then pass the byte array to some type of stream object.

Public NotInheritable Class BitConverter
                  ' Public Shared Fields
   Public Shared ReadOnly IsLittleEndian As Boolean              // =True
                  ' Public Shared Methods
   Public Shared Function DoubleToInt64Bits(
        ByVal value As Double) As Long  
   Public Shared Function GetBytes(
        ByVal value As Boolean) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As Char) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As Double) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As Short) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As Integer) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As Long) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As Single) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As UInt16) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As UInt32) As Byte()  
   Public Shared Function GetBytes(
        ByVal value As UInt64) As Byte()  
   Public Shared Function Int64BitsToDouble(
        ByVal value As Long) As Double  
   Public Shared Function ToBoolean(ByVal value As Byte(), ByVal startIndex As Integer) As Boolean ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.