OutputStream.writeBytesAsync
void writeBytesAsync(glib.bytes.Bytes bytes, int ioPriority, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)This function is similar to gio.output_stream.OutputStream.writeAsync, but takes a #GBytes as input. Due to the refcounted nature of #GBytes, this allows the stream to avoid taking a copy of the data.
However, note that this function may still perform partial writes, just like gio.output_stream.OutputStream.writeAsync. If that occurs, to continue writing, you will need to create a new #GBytes containing just the remaining bytes, using glib.bytes.Bytes.newFromBytes. Passing the same #GBytes instance multiple times potentially can result in duplicated data in the output stream.
For the synchronous, blocking version of this function, see gio.output_stream.OutputStream.writeBytes.
Parameters
bytes | The bytes to write |
ioPriority | the io priority of the request. |
cancellable | optional #GCancellable object, null to ignore. |
callback | a #GAsyncReadyCallback to call when the request is satisfied |