-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Kotlin's
bytes
type from UByteArray
to ByteArray
This reflects the fact that `ByteArray` is a lot more common than `UByteArray`.
- Loading branch information
1 parent
e5c8f75
commit 8d82ffb
Showing
6 changed files
with
21 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
uniffi_bindgen/src/bindings/kotlin/templates/ByteArrayHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
public object FfiConverterByteArray: FfiConverterRustBuffer<ByteArray> { | ||
override fun read(buf: ByteBuffer): ByteArray { | ||
val len = buf.getInt() | ||
val byteArr = ByteArray(len) | ||
buf.get(byteArr) | ||
return byteArr | ||
} | ||
override fun allocationSize(value: ByteArray): Int { | ||
return 4 + value.size | ||
} | ||
override fun write(value: ByteArray, buf: ByteBuffer) { | ||
buf.putInt(value.size) | ||
buf.put(value) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
uniffi_bindgen/src/bindings/kotlin/templates/UByteArrayHelper.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters