Convert bytes to UInt32 : BitConverter « Development « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Development » BitConverterScreenshots 
Convert bytes to UInt32
 

Module Example
   Public Sub Main()
      Dim value As Integer = -16
      Dim bytes() As Byte = BitConverter.GetBytes(value

      Dim uintValue As UInteger = BitConverter.ToUInt32(bytes, 0)
      Console.WriteLine("{0} = {1}: {2}", value, uintValue, 
                        If(value.Equals(uintValue)"Round-trips""Does not round-trip"))

   End Sub
End Module

   
  
Related examples in the same category
1.Example of the BitConverter.GetBytes( UInt32 ) method.
2.Example of the BitConverter.ToString( Byte( ) ) method.
3.Convert Byte arrays to String objects with the ToString method.
4.BitConverter.GetBytes Returns the specified 16-bit unsigned integer value as an array of bytes.
5.BitConverter.GetBytes Method Returns the specified 32-bit unsigned integer value as an array of bytes.
6.BitConverter.GetBytes(UInt64) Returns the specified 64-bit unsigned integer value as an array of bytes.
7.BitConverter Class converts base data types to an array of bytes, and an array of bytes to base data types.
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
w___ww_.___j___a___v_a2_s.___co_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.