Skip to content

okio / okio / BufferedSource / read

read

(js, jvm, native) 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.

(js, jvm, native) 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.