SimpleIOStream

gio.simple_iostream.SimpleIOStream creates a gio.iostream.IOStream from an arbitrary gio.input_stream.InputStream and gio.output_stream.OutputStream. This allows any pair of input and output streams to be used with gio.iostream.IOStream methods.

This is useful when you obtained a gio.input_stream.InputStream and a gio.output_stream.OutputStream by other means, for instance creating them with platform specific methods as `[gio.unix_input_stream.UnixInputStream.new_]`

(from gio-unix-2.0.pc / GioUnix-2.0), and you want to take advantage of the methods provided by gio.iostream.IOStream.

Constructors

this
this(gio.input_stream.InputStream inputStream, gio.output_stream.OutputStream outputStream)

Creates a new #GSimpleIOStream wrapping input_stream and output_stream. See also #GIOStream.

Inherited Members

From IOStream

spliceFinish
bool spliceFinish(gio.async_result.AsyncResult result)

Finishes an asynchronous io stream splice operation.

clearPending
void clearPending()

Clears the pending flag on stream.

close
bool close(gio.cancellable.Cancellable cancellable)

Closes the stream, releasing resources related to it. This will also close the individual input and output streams, if they are not already closed.

closeAsync
void closeAsync(int ioPriority, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Requests an asynchronous close of the stream, releasing resources related to it. When the operation is finished callback will be called. You can then call gio.iostream.IOStream.closeFinish to get the result of the operation.

closeFinish
bool closeFinish(gio.async_result.AsyncResult result)

Closes a stream.

getInputStream
gio.input_stream.InputStream getInputStream()

Gets the input stream for this object. This is used for reading.

getOutputStream
gio.output_stream.OutputStream getOutputStream()

Gets the output stream for this object. This is used for writing.

hasPending
bool hasPending()

Checks if a stream has pending actions.

isClosed
bool isClosed()

Checks if a stream is closed.

setPending
bool setPending()

Sets stream to have actions pending. If the pending flag is already set or stream is closed, it will return false and set error.

spliceAsync
void spliceAsync(gio.iostream.IOStream stream2, gio.types.IOStreamSpliceFlags flags, int ioPriority, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Asynchronously splice the output stream of stream1 to the input stream of stream2, and splice the output stream of stream2 to the input stream of stream1.