Debian Codegraph @

third_party/rust/uniffi_bindgen/src/bindings/kotlin/templates/ByteArrayHelper.kt

raw
1 /**
2 * @suppress
3 */
4 public object FfiConverterByteArray: FfiConverterRustBuffer<ByteArray> {
5 override fun read(buf: ByteBuffer): ByteArray {
6 val len = buf.getInt()
7 val byteArr = ByteArray(len)
8 buf.get(byteArr)
9 return byteArr
10 }
11 override fun allocationSize(value: ByteArray): ULong {
12 return 4UL + value.size.toULong()
13 }
14 override fun write(value: ByteArray, buf: ByteBuffer) {
15 buf.putInt(value.size)
16 buf.put(value)
17 }
18 }