mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Added intFromAlingedBytes.
This commit is contained in:
@@ -126,6 +126,16 @@ class DataWithPointer {
|
||||
return self.bitArray[self.index - 1]
|
||||
}
|
||||
|
||||
func intFromAlingedBytes(count: Int) -> Int {
|
||||
self.skipUntilNextByte()
|
||||
var result = 0
|
||||
for i in 0..<count {
|
||||
result |= self.bitArray[self.index].toInt() << (8 * i)
|
||||
self.index += 1
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// MARK: Manipulations with index and bitShift
|
||||
|
||||
func skipUntilNextByte() {
|
||||
|
||||
Reference in New Issue
Block a user