Just to be absolutely in sync with GitHub. This is just a sketch.
Signed-off-by: Adam Rocska <adam.rocska@adams.solutions>
This commit is contained in:
parent
d37ac6856c
commit
b581f12b4f
|
@ -7,15 +7,21 @@ import Foundation
|
|||
|
||||
class Decoder {
|
||||
|
||||
private let pointerBaseByteSize: UInt
|
||||
private let data: Data
|
||||
private var pointerBase: UInt
|
||||
private let pointerBaseByteSize: UInt
|
||||
private lazy var switchByteOrder: Bool = { 0.littleEndian == 0 }()
|
||||
|
||||
init(pointerBase: UInt = 0) {
|
||||
init(data: Data, pointerBase: UInt = 0) {
|
||||
precondition(log(Float(pointerBase)).truncatingRemainder(dividingBy: 8.0) == 0)
|
||||
|
||||
self.pointerBaseByteSize = UInt(log(Float(pointerBase)) / 8.0)
|
||||
self.data = data
|
||||
self.pointerBase = pointerBase
|
||||
self.pointerBaseByteSize = UInt(log(Float(pointerBase)) / 8.0)
|
||||
}
|
||||
|
||||
func decode(from offset: Data.Index) {
|
||||
let controlByte = data[offset]
|
||||
let typeIdentifier = controlByte >> 5
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue