read

common
abstract fun read(sink: ByteArray): Int

Removes up to sink.length bytes from this and copies them into sink. Returns the number of bytes read, or -1 if this source is exhausted.

abstract fun read(sink: ByteArray): Int
abstract fun read(sink: ByteArray, offset: Int, byteCount: Int): Int
common
abstract fun read(sink: ByteArray, offset: Int, byteCount: Int): Int

Removes up to byteCount bytes from this and copies them into sink at offset. Returns the number of bytes read, or -1 if this source is exhausted.