read

abstract fun read(buffer: ByteArray, offset: Int, length: Int): Int(source)

Reads up to length bytes from the current position into buffer starting at offset.

Advances the stream position by the number of bytes actually read.

Return

the number of bytes read into buffer, or -1 if the end of the stream has been reached.

Parameters

buffer

the destination byte array into which data is read.

offset

the start offset in buffer at which the data is written.

length

the maximum number of bytes to read.