Open JakeWharton opened 4 years ago
Yes!
Probably
BufferedSink.write(ArrayBuffer)
+ offset/countBufferedSource.readArrayBuffer
+ count overloadArrayBuffer.toByteString
ByteString.asArrayBuffer
(or "to"?)Currently just cheating with:
private fun ArrayBuffer.toByteString(): ByteString {
val uint8Array = Uint8Array(this)
val buffer = Buffer()
for (i in 0 until uint8Array.length) {
buffer.writeByte(uint8Array[i].toInt())
}
return buffer.readByteString()
}
ArrayBuffer
,UInt8Array
, etc.