pollableStreamWriteAll

fnbool pollableStreamWriteAll(gio.output_stream.OutputStream stream, ubyte[] buffer, bool blocking, out size_t bytesWritten, gio.cancellable.Cancellable cancellable = null)

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.

Parameters

streama #GOutputStream.
bufferthe buffer containing the data to write.
blockingwhether to do blocking I/O
bytesWrittenlocation to store the number of bytes that was written to the stream
cancellableoptional #GCancellable object, null to ignore.

Returns

true on success, false if there was an error

Throws

[ErrorWrap]