PollableInputStream.isReadable

bool isReadable()

Checks if stream can be read.

Note that some stream types may not be able to implement this 100% reliably, and it is possible that a call to [gio.input_stream.InputStream.read] after this returns true would still block. To guarantee non-blocking behavior, you should always use [gio.pollable_input_stream.PollableInputStream.readNonblocking], which will return a [gio.types.IOErrorEnum.WouldBlock] error rather than blocking.

The behaviour of this method is undefined if [gio.pollable_input_stream.PollableInputStream.canPoll] returns false for stream.

Returns

true if stream is readable, false if not. If an error

has occurred on stream, this will result in [gio.pollable_input_stream.PollableInputStream.isReadable] returning true, and the next attempt to read will return the error.