chunked
Splits the data into chunks of given length. The last chunk may be shorter.
Example
val data = byteArrayOf(1, 2, 3, 4, 5)
val chunks = data.chunked(2)
// chunks: [ [1, 2], [3, 4], [5] ]Content copied to clipboard
Return
A list of chunks.
Parameters
size
The maximum size of a chunk.