readAllBytes

fun readAllBytes(chunk: Int, read: (ByteArray) -> Int): ByteArray(source)

Joins what read fills into a chunk-sized buffer until it returns 0 or less.