ConverterInputStream

Converter input stream implements gio.input_stream.InputStream and allows conversion of data of various types during reading.

As of GLib 2.34, gio.converter_input_stream.ConverterInputStream implements gio.pollable_input_stream.PollableInputStream.

Constructors

this
this(gio.input_stream.InputStream baseStream, gio.converter.Converter converter)

Creates a new converter input stream for the base_stream.

Members

Functions

getConverter
gio.converter.Converter getConverter()

Gets the #GConverter that is used by converter_stream.

Mixed In Members

From mixin PollableInputStreamT!()

canPoll
bool canPoll()

Checks if stream is actually pollable. Some classes may implement #GPollableInputStream but have only certain instances of that class be pollable. If this method returns false, then the behavior of other #GPollableInputStream methods is undefined.

createSource
glib.source.Source createSource(gio.cancellable.Cancellable cancellable)

Creates a #GSource that triggers when stream can be read, or cancellable is triggered or an error occurs. The callback on the source is of the #GPollableSourceFunc type.

isReadable
bool isReadable()

Checks if stream can be read.

readNonblocking
ptrdiff_t readNonblocking(ubyte[] buffer, gio.cancellable.Cancellable cancellable)

Attempts to read up to count bytes from stream into buffer, as with gio.input_stream.InputStream.read. If stream is not currently readable, this will immediately return gio.types.IOErrorEnum.WouldBlock, and you can use gio.pollable_input_stream.PollableInputStream.createSource to create a #GSource that will be triggered when stream is readable.

Inherited Members

From FilterInputStream

getBaseStream
gio.input_stream.InputStream getBaseStream()

Gets the base stream for the filter stream.

getCloseBaseStream
bool getCloseBaseStream()

Returns whether the base stream will be closed when stream is closed.

setCloseBaseStream
void setCloseBaseStream(bool closeBase)

Sets whether the base stream will be closed when stream is closed.

From PollableInputStream

canPoll
bool canPoll()

Checks if stream is actually pollable. Some classes may implement #GPollableInputStream but have only certain instances of that class be pollable. If this method returns false, then the behavior of other #GPollableInputStream methods is undefined.

createSource
glib.source.Source createSource(gio.cancellable.Cancellable cancellable)

Creates a #GSource that triggers when stream can be read, or cancellable is triggered or an error occurs. The callback on the source is of the #GPollableSourceFunc type.

isReadable
bool isReadable()

Checks if stream can be read.

readNonblocking
ptrdiff_t readNonblocking(ubyte[] buffer, gio.cancellable.Cancellable cancellable)

Attempts to read up to count bytes from stream into buffer, as with gio.input_stream.InputStream.read. If stream is not currently readable, this will immediately return gio.types.IOErrorEnum.WouldBlock, and you can use gio.pollable_input_stream.PollableInputStream.createSource to create a #GSource that will be triggered when stream is readable.