readLimited

fun readLimited(input: InputStream, maxBytes: Long = MAX_STREAM_BYTES): ByteArray

Reads all bytes from input up to maxBytes.

Throws

if the stream exceeds maxBytes.