We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e122b3 + 798aaa3 commit 481338aCopy full SHA for 481338a
src/main/kotlin/ab/appBuffer.kt
@@ -190,6 +190,12 @@ object appBuffer {
190
return bytes
191
}
192
193
+ inline fun bufferOfUtf8(string: String, nullTerminated: Boolean = true): ByteBuffer {
194
+ val bytes = buffer(MemoryUtil.memLengthUTF8(string, nullTerminated))
195
+ MemoryUtil.memUTF8(string, nullTerminated, bytes)
196
+ return bytes
197
+ }
198
+
199
inline fun intBuffer(size: Int): IntBuffer = MemoryUtil.memIntBuffer(ptr.advance(Int.BYTES * size), size)
200
inline fun intBuffer(size: Int, block: (Int) -> Int): IntBuffer {
201
val res = intBuffer(size)
0 commit comments