readRange

open fun readRange(input: InputStream, len: Int): Array<Byte>

Gets part of the contents of an InputStream as a byte[].

Return

the requested byte array

Since

1.21

Parameters

input

the InputStream to read from

len

maximum amount of bytes to copy

Throws

if the input is null

if an I/O error occurs


open fun readRange(input: ReadableByteChannel, len: Int): Array<Byte>

Gets part of the contents of an ReadableByteChannel as a byte[].

Return

the requested byte array

Since

1.21

Parameters

input

the ReadableByteChannel to read from

len

maximum amount of bytes to copy

Throws

if the input is null

if an I/O error occurs