Gio.DataInputStream.prototype.read_upto_async
function read_upto_async(stop_chars: String, stop_chars_len: Number(gssize), io_priority: Number(gint), cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback): void { // Gjs wrapper for g_data_input_stream_read_upto_async() }
The asynchronous version of Gio.DataInputStream.prototype.read_upto. It is an error to have two outstanding calls to this function.
In contrast to Gio.DataInputStream.prototype.read_until, this function does not consume the stop character. You have to use Gio.DataInputStream.prototype.read_byte to get it before calling Gio.DataInputStream.prototype.read_upto again.
Note that stop_chars may contain '\0' if stop_chars_len is specified.
When the operation is finished, callback will be called. You can then call Gio.DataInputStream.prototype.read_upto_finish to get the result of the operation.
Since 2.26
- stop_chars
characters to terminate the read
- stop_chars_len
length of stop_chars. May be -1 if stop_chars is nul-terminated
- io_priority
the [I/O priority][io-priority] of the request
- cancellable
optional Gio.Cancellable object, null to ignore
- callback
callback to call when the request is satisfied