Example of the BitConverter.GetBytes( UInt32 ) method. : BitConverter « Development « VB.Net






Example of the BitConverter.GetBytes( UInt32 ) method.

    


Imports System
Imports Microsoft.VisualBasic

Module GetBytesUInt32Demo
    Sub GetBytesUInt32( argument As UInt32 )
        Dim byteArray As Byte( ) = BitConverter.GetBytes( argument )
        Console.WriteLine( BitConverter.ToString( byteArray ) )
    End Sub 

    Sub Main( )
        GetBytesUInt32( Convert.ToUInt32( 15 ) )
        GetBytesUInt32( Convert.ToUInt32( &H100000 ) )
        GetBytesUInt32( Convert.ToUInt32( Int32.MaxValue ) )
    End Sub 
End Module

   
    
    
    
  








Related examples in the same category

1.Example of the BitConverter.ToString( Byte( ) ) method.
2.Convert Byte arrays to String objects with the ToString method.
3.BitConverter.GetBytes Returns the specified 16-bit unsigned integer value as an array of bytes.
4.BitConverter.GetBytes Method Returns the specified 32-bit unsigned integer value as an array of bytes.
5.BitConverter.GetBytes(UInt64) Returns the specified 64-bit unsigned integer value as an array of bytes.
6.BitConverter Class converts base data types to an array of bytes, and an array of bytes to base data types.
7.Convert bytes to UInt32
8.Convert values to Byte arrays and display them
9.BitConverter.DoubleToInt64Bits converts double-precision floating point number to a 64-bit signed integer.
10.BitConverter.GetBytes returns the specified Boolean value as an array of bytes.
11.BitConverter.GetBytes returns the specified Unicode character value as an array of bytes.
12.BitConverter.GetBytes returns double-precision floating point value as an array of bytes.
13.BitConverter.GetBytes (Int16) returns 16-bit signed integer value as an array of bytes.
14.BitConverter.GetBytes (Int32) returns 32-bit signed integer value as an array of bytes.
15.BitConverter.GetBytes (Int64) returns the specified 64-bit signed integer value as an array of bytes.
16.BitConverter.GetBytes (Single) returns single-precision floating point value as an array of bytes.
17.BitConverter.GetBytes (UInt16) returns 16-bit unsigned integer value as an array of bytes.
18.BitConverter.GetBytes (UInt32) returns 32-bit unsigned integer value as an array of bytes.
19.BitConverter.GetBytes (UInt64) returns 64-bit unsigned integer value as an array of bytes.
20.BitConverter.Int64BitsToDouble converts 64-bit signed integer to a double-precision floating point number.
21.BitConverter.IsLittleEndian indicates the byte order in which data is stored in this computer architecture.
22.BitConverter.ToBoolean returns a Boolean value converted from one byte at a specified position in a byte array.
23.BitConverter.ToChar returns a Unicode character converted from two bytes at a specified position in a byte array.
24.BitConverter.ToDouble returns a double converted from eight bytes at a specified position in a byte array.
25.BitConverter.ToInt16 returns a 16-bit signed integer converted from two bytes
26.BitConverter.ToInt32 returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.
27.BitConverter.ToSingle returns a single-precision float number converted from four bytes
28.BitConverter.ToUInt16 returns a 16-bit unsigned integer converted from two bytes
29.BitConverter.ToUInt32 returns a 32-bit unsigned integer converted from four bytes