get
fun ByteBuffer.get(destination: ByteArray, destinationOffset: Int = 0, kapacity: Kapacity): ByteBuffer
Reads up to the specified kapacity of bytes from this buffer into the destination array.
Warning on Bounds: This operation safely clamps the number of bytes read to prevent BufferUnderflowException and IndexOutOfBoundsException. The actual number of bytes transferred will be the minimum of: the requested kapacity, the ByteBuffer.remaining bytes in this buffer, or the available space in the destination array accounting for the destinationOffset.
Return
This buffer, to allow for fluent method chaining.
Parameters
destination
The byte array to write the data into.
destinationOffset
The index within the destination array to begin writing. Defaults to 0.
kapacity
The maximum amount of data to read from this buffer.