Tries to write count bytes to stream, as with OutputStream.writeAll, but using g_pollable_stream_write() rather than 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 G_IO_ERROR_WOULD_BLOCK 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 g_pollable_stream_write(), if blocking is FALSE, then stream must be a GPollableOutputStream for which g_pollable_output_stream_can_poll() returns TRUE or else the behavior is undefined. If blocking is TRUE, then stream does not need to be a GPollableOutputStream



stream OutputStream
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 Cancellable

optional gio.Cancellable object, NULL to ignore.

Return Value

Type: bool

TRUE on success, FALSE if there was an error


GException on failure.