From 9b835ed23e6e04979159d11766b1f4b53e1f7c68 Mon Sep 17 00:00:00 2001 From: godotg Date: Sun, 28 Jul 2024 17:24:19 +0800 Subject: [PATCH] feat[swift]: support swift protocol --- protocol/src/main/resources/swift/ByteBuffer.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/protocol/src/main/resources/swift/ByteBuffer.swift b/protocol/src/main/resources/swift/ByteBuffer.swift index 1be8b601..b9e695cc 100644 --- a/protocol/src/main/resources/swift/ByteBuffer.swift +++ b/protocol/src/main/resources/swift/ByteBuffer.swift @@ -64,6 +64,14 @@ class ByteBuffer { return Array(bytes) } + func writeUBytes(_ bytes: [UInt8]) { + let length = bytes.count + ensureCapacity(length) + for ubyte in bytes { + writeUByte(ubyte) + } + } + func toBytes() -> [Int8] { return Array(buffer[0..