|
|
@ -32,10 +32,10 @@ object ConvertUtils { |
|
|
|
|
|
|
|
|
|
|
|
fun toInt(bytes: ByteArray): Int { |
|
|
|
fun toInt(bytes: ByteArray): Int { |
|
|
|
var result = 0 |
|
|
|
var result = 0 |
|
|
|
var abyte: Byte |
|
|
|
var byte: Byte |
|
|
|
for (i in bytes.indices) { |
|
|
|
for (i in bytes.indices) { |
|
|
|
abyte = bytes[i] |
|
|
|
byte = bytes[i] |
|
|
|
result += (abyte.toInt() and 0xFF).shl(8 * i) |
|
|
|
result += (byte.toInt() and 0xFF).shl(8 * i) |
|
|
|
} |
|
|
|
} |
|
|
|
return result |
|
|
|
return result |
|
|
|
} |
|
|
|
} |
|
|
|