read

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

Reads up to length bytes; -1 at the end of the stream, on an error or on a timeout.