Mega Code Archive

 
Categories / VB.Net / Development
 

BitConverter ToInt32 returns a 32-bit signed integer converted from four bytes at a specified position in a byte array

Imports System Imports Microsoft.VisualBasic Module BytesToInt32Demo     Sub BAToInt32( bytes( ) As Byte, index As Integer )         Dim value As Integer = BitConverter.ToInt32( bytes, index )         Console.WriteLine(value )     End Sub      Sub Main( )         Dim byteArray as Byte( ) = {0, 240, 255,   0, 202, 154,  59,   0,  54, 101, _             196, 241, 255, 255, 255, 127 }         BAToInt32( byteArray, 1 )     End Sub  End Module