pollableStreamWriteAll

Tries to write count bytes to stream, as with gio.output_stream.OutputStream.writeAll, but using gio.global.pollableStreamWrite rather than gio.output_stream.OutputStream.write.

On a successful write of count bytes, true is returned, and bytes_written is set to count.

If there is an error during the operation (including gio.types.IOErrorEnum.WouldBlock in the non-blocking case), false is returned and error is set to indicate the error status, bytes_written is updated to contain the number of bytes written into the stream before the error occurred.

As with gio.global.pollableStreamWrite, if blocking is false, then stream must be a #GPollableOutputStream for which gio.pollable_output_stream.PollableOutputStream.canPoll returns true or else the behavior is undefined. If blocking is true, then stream does not need to be a #GPollableOutputStream.

bool
pollableStreamWriteAll

Parameters

stream gio.output_stream.OutputStream

a #GOutputStream.

buffer ubyte[]

the buffer containing the data to write.

blocking bool

whether to do blocking I/O

bytesWritten size_t

location to store the number of bytes that was written to the stream

cancellable gio.cancellable.Cancellable

optional #GCancellable object, null to ignore.

Return Value

Type: bool

true on success, false if there was an error