read

abstract fun read(byteBuffer: ByteBuffer): Int(source)

Reads a sequence of bytes from this source at the current position into byteBuffer.

Up to byteBuffer.remaining() bytes are transferred, and both this source's position and byteBuffer.position() are advanced by the number of bytes read.

Return

the number of bytes read, or -1 if the source has reached end-of-stream.

Parameters

byteBuffer

the destination buffer into which bytes are transferred.