Sub AppStart (Args() As String)
Dim bc As ByteConverter
Dim octets() As Byte = Array As Byte(1, 2, 3, 4, 5, 6, 7, 8)
Dim longs() As Long = bc.LongsFromBytes(octets)
Log(longs(0))
Log(OctetsToLong(octets))
End Sub
Private Sub OctetsToLong(Octets() As Byte) As Long
Dim res As Long
For Each oct As Byte In Octets
res = Bit.ShiftLeftLong(res, 8)
res = Bit.OrLong(res, Bit.And(0xff, oct))
Next
Return res
End Sub
Sub AppStart (Args() As String)
Dim bc As ByteConverter
Dim octets() As Byte = Array As Byte(1, 2, 3, 4, 5, 6, 7, 8)
Dim longs() As Long = bc.LongsFromBytes(octets)
Log(longs(0))
Log(OctetsToLong(octets))
End Sub
Private Sub OctetsToLong(Octets() As Byte) As Long
Dim res As Long
For Each oct As Byte In Octets
res = Bit.ShiftLeftLong(res, 8)
res = Bit.OrLong(res, Bit.And(0xff, oct))
Next
Return res
End Sub