sok / Sok.Buffer / JSMultiplatformBuffer / getBytesImpl
fun getBytesImpl(length:
Int
, index:
Int
?):
ByteArray
(source)
Platform and version requirements: JS
Get an array of bytes of a given length starting at the current buffer cursor position. If the index parameter is provided, the cursor will be ignored and not modified
length
- amount of data to get
index
- index of the first byte, buffer.cursor is used if the index is null
Return data copied from the buffer
fun getBytesImpl(array:
ByteArray
, index:
Int
?, destinationOffset:
Int
, length:
Int
):
Unit
(source)
Platform and version requirements: JS
Copy bytes into the array starting from the current cursor position or given index. You can start the copy with an offset in the destination array and specify the number of byte you want to be copied.
array
- destination array
index
- index of the first byte, buffer.cursor is used if the index is null
destinationOffset
- The offset within the array of the first byte to be written
length
- amount of data to copy