blob: 88e3a41a22ca4022279b4e323e772338d8e8a2f5 [file] [log] [blame]
import Foundation
public struct Struct {
public private(set) var bb: ByteBuffer
public private(set) var postion: Int32
public init(bb: ByteBuffer, position: Int32 = 0) {
self.bb = bb
self.postion = position
}
public func readBuffer<T: Scalar>(of type: T.Type, at o: Int32) -> T {
let r = bb.read(def: T.self, position: Int(o + postion))
return r
}
}