read

abstract fun read(): StringOrBufferOrAny

The readable.read() method reads some data from the readable stream and returns it. The data will not be returned immediately if the readable stream is in flowing mode; in that case, the data will be buffered internally, and this method will return it when it is available.

If the stream has ended, null will be returned. If there is no data available, null will be returned.

Return

The data read from the stream.


abstract fun read(size: Value): StringOrBufferOrAny
abstract fun read(size: Int): StringOrBufferOrAny

The readable.read() method reads some data from the readable stream and returns it. The data will not be returned immediately if the readable stream is in flowing mode; in that case, the data will be buffered internally, and this method will return it when it is available.

If the stream has ended, null will be returned. If there is no data available, null will be returned.

Return

The data read from the stream.

Parameters

size

The number of bytes to read. If not specified, all available data is read.