mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-11 03:13:51 +00:00
feat[swift]: support swift protocol
This commit is contained in:
1 parent
a4e7c0d5fa
commit
9b835ed23e
1 file changed
+8
@@ -64,6 +64,14 @@ class ByteBuffer {
|
||||
return Array<Int8>(bytes)
|
||||
}
|
||||
|
||||
func writeUBytes(_ bytes: [UInt8]) {
|
||||
let length = bytes.count
|
||||
ensureCapacity(length)
|
||||
for ubyte in bytes {
|
||||
writeUByte(ubyte)
|
||||
}
|
||||
}
|
||||
|
||||
func toBytes() -> [Int8] {
|
||||
return Array<Int8>(buffer[0..<writeOffset])
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user