Hallo.
Ich habe hier einige alte Methoden. Eventuell kann mir jemand sagen, ob es
da neuere Möglichkeiten gibt, dies zu realisieren:
'Big Endian Konvertierung
'Nummer-Odd Prüfung
Danke im Voraus!
Ich habe hier einige alte Methoden. Eventuell kann mir jemand sagen, ob es
da neuere Möglichkeiten gibt, dies zu realisieren:
'Big Endian Konvertierung
'Nummer-Odd Prüfung
VB.NET-Quellcode
- Private Function CVL(st As Integer, endIndex As Integer) As Long
- endIndex = endIndex + 1
- Dim retus(7) As Byte
- Dim Length As Integer = endIndex - st
- Dim Bit64 As Boolean = False
- If Length = 0 Or Length > 9 Then Return Nothing
- If Length = 1 Then
- retus(0) = CByte((db_bytes(st) And &H7F))
- Return BitConverter.ToInt64(retus, 0)
- End If
- If Length = 9 Then Bit64 = True
- Dim j As Integer = 1
- Dim k As Integer = 7
- Dim y As Integer = 0
- If Bit64 Then
- retus(0) = db_bytes(endIndex - 1)
- endIndex = endIndex - 1
- y = 1
- End If
- For i As Integer = (endIndex - 1) To st Step -1
- If (i - 1) >= st Then
- retus(y) = CByte(((db_bytes(i) >> (j - 1)) And (&HFF >> j)) Or (db_bytes(i - 1) << k))
- j = j + 1
- y = y + 1
- k = k - 1
- Else
- If Not Bit64 Then retus(y) = CByte(((db_bytes(i) >> (j - 1)) And (&HFF >> j)))
- End If
- Next
- Return BitConverter.ToInt64(retus, 0)
- End Function
Danke im Voraus!