mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
no message
This commit is contained in:
@@ -58,6 +58,11 @@ public struct ValueBoxKey: Hashable, CustomStringConvertible, Comparable {
|
||||
memcpy(self.memory + offset, &varValue, 1)
|
||||
}
|
||||
|
||||
public func setUInt8(_ offset: Int, value: UInt8) {
|
||||
var varValue = value
|
||||
memcpy(self.memory + offset, &varValue, 1)
|
||||
}
|
||||
|
||||
public func getInt32(_ offset: Int) -> Int32 {
|
||||
var value: Int32 = 0
|
||||
memcpy(&value, self.memory + offset, 4)
|
||||
@@ -82,6 +87,12 @@ public struct ValueBoxKey: Hashable, CustomStringConvertible, Comparable {
|
||||
return value
|
||||
}
|
||||
|
||||
public func getUInt8(_ offset: Int) -> UInt8 {
|
||||
var value: UInt8 = 0
|
||||
memcpy(&value, self.memory + offset, 1)
|
||||
return value
|
||||
}
|
||||
|
||||
public func prefix(_ length: Int) -> ValueBoxKey {
|
||||
assert(length <= self.length, "length <= self.length")
|
||||
let key = ValueBoxKey(length: length)
|
||||
|
||||
Reference in New Issue
Block a user