[14:7] extends: object
Data input stream implements [class@Gio.InputStream] and includes functions for reading structured data directly from a binary input stream.
GDataInputStream (base_stream = null)
Creates a new data input stream for the @base_stream.
base_stream is a #GInputStream..toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asBufferedInputStream ()
Wraps this handle as
GBufferedInputStream.
A GBufferedInputStream object.asSeekable ()
Wraps this handle as
GSeekable.
A GSeekable object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setByteorder (string Value)
The :byte-order property determines the byte ordering that is used when reading multi-byte entities (such as integers) from the stream.
Value is the new property value.None.setNewlinetype (string Value)
The :newline-type property determines what is considered as a line ending when reading complete lines from the stream.
Value is the new property value.None.get_byte_order ()
Gets the byte order for the data input stream.
the @stream's current #GDataStreamByteOrder..get_newline_type ()
Gets the current newline type for the @stream.
#GDataStreamNewlineType for the given @stream..read_byte (object cancellable)
Reads an unsigned 8-bit/1-byte value from @stream.
cancellable is optional #GCancellable object, %NULL to ignore..an unsigned 8-bit/1-byte value read from the @stream or 0 if an error occurred..read_int16 (object cancellable)
Reads a 16-bit/2-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
cancellable is optional #GCancellable object, %NULL to ignore..a signed 16-bit/2-byte value read from @stream or 0 if an error occurred..read_int32 (object cancellable)
Reads a signed 32-bit/4-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
cancellable is optional #GCancellable object, %NULL to ignore..a signed 32-bit/4-byte value read from the @stream or 0 if an error occurred..read_int64 (object cancellable)
Reads a 64-bit/8-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
cancellable is optional #GCancellable object, %NULL to ignore..a signed 64-bit/8-byte value read from @stream or 0 if an error occurred..read_line (object cancellable)
Reads a line from the data input stream. Note that no encoding checks or conversion is performed; the input is not guaranteed to be UTF-8, and may in fact have embedded NUL characters. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
length is a #gsize to get the length of the data read in..cancellable is optional #GCancellable object, %NULL to ignore..a NUL terminated byte array with the line that was read in (without the newlines). Set @length to a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. If there's no content to read, it will still return %NULL, but @error won't be set..read_line_async (int io_priority, object cancellable, user_data)
The asynchronous version of g_data_input_stream_read_line(). It is an error to have two outstanding calls to this function. When the operation is finished, @callback will be called. You can then call g_data_input_stream_read_line_finish() to get the result of the operation.
io_priority is the I/O priority of the request.cancellable is optional #GCancellable object, %NULL to ignore..callback is callback to call when the request is satisfied..user_data is the data to pass to callback function..None.read_line_finish (object result)
Finish an asynchronous call started by g_data_input_stream_read_line_async(). Note the warning about string encoding in g_data_input_stream_read_line() applies here as well.
result is the #GAsyncResult that was provided to the callback..length is a #gsize to get the length of the data read in..a NUL-terminated byte array with the line that was read in (without the newlines). Set @length to a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. If there's no content to read, it will still return %NULL, but @error won't be set..read_line_finish_utf8 (object result)
Finish an asynchronous call started by g_data_input_stream_read_line_async().
result is the #GAsyncResult that was provided to the callback..length is a #gsize to get the length of the data read in..a string with the line that was read in (without the newlines). Setto a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. For UTF-8 conversion errors, the set error domain is %G_CONVERT_ERROR. If there's no content to read, it will still return %NULL, but @error won't be set..read_line_utf8 (object cancellable)
Reads a UTF-8 encoded line from the data input stream. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
length is a #gsize to get the length of the data read in..cancellable is optional #GCancellable object, %NULL to ignore..a NUL terminated UTF-8 string with the line that was read in (without the newlines). Set @length to a #gsize to get the length of the read line. On an error, it will return %NULL and @error will be set. For UTF-8 conversion errors, the set error domain is %G_CONVERT_ERROR. If there's no content to read, it will still return %NULL, but @error won't be set..read_uint16 (object cancellable)
Reads an unsigned 16-bit/2-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
cancellable is optional #GCancellable object, %NULL to ignore..an unsigned 16-bit/2-byte value read from the @stream or 0 if an error occurred..read_uint32 (object cancellable)
Reads an unsigned 32-bit/4-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
cancellable is optional #GCancellable object, %NULL to ignore..an unsigned 32-bit/4-byte value read from the @stream or 0 if an error occurred..read_uint64 (object cancellable)
Reads an unsigned 64-bit/8-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_input_stream_get_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
cancellable is optional #GCancellable object, %NULL to ignore..an unsigned 64-bit/8-byte read from @stream or 0 if an error occurred..read_until (string stop_chars, object cancellable)
Reads a string from the data input stream, up to the first occurrence of any of the stop characters. Note that, in contrast to g_data_input_stream_read_until_async(), this function consumes the stop character that it finds. Don't use this function in new code. Its functionality is inconsistent with g_data_input_stream_read_until_async(). Both functions will be marked as deprecated in a future release. Use g_data_input_stream_read_upto() instead, but note that that function does not consume the stop character.
stop_chars is characters to terminate the read..length is a #gsize to get the length of the data read in..cancellable is optional #GCancellable object, %NULL to ignore..a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error..read_until_async (string stop_chars, int io_priority, object cancellable, user_data)
The asynchronous version of g_data_input_stream_read_until(). It is an error to have two outstanding calls to this function. Note that, in contrast to g_data_input_stream_read_until(), this function does not consume the stop character that it finds. You must read it for yourself. When the operation is finished, @callback will be called. You can then call g_data_input_stream_read_until_finish() to get the result of the operation. Don't use this function in new code. Its functionality is inconsistent with g_data_input_stream_read_until(). Both functions will be marked as deprecated in a future release. Use g_data_input_stream_read_upto_async() instead.
stop_chars is characters to terminate the read..io_priority is the I/O priority of the request.cancellable is optional #GCancellable object, %NULL to ignore..callback is callback to call when the request is satisfied..user_data is the data to pass to callback function..None.read_until_finish (object result)
Finish an asynchronous call started by g_data_input_stream_read_until_async().
result is the #GAsyncResult that was provided to the callback..length is a #gsize to get the length of the data read in..a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error..read_upto (string stop_chars, int stop_chars_len, object cancellable)
Reads a string from the data input stream, up to the first occurrence of any of the stop characters. In contrast to g_data_input_stream_read_until(), this function does not consume the stop character. You have to use g_data_input_stream_read_byte() to get it before calling g_data_input_stream_read_upto() again. Note that
may contain '\0' if @stop_chars_len is specified. The returned string will always be nul-terminated on success.stop_chars is characters to terminate the read.stop_chars_len is length of @stop_chars. May be -1 if @stop_chars is nul-terminated.length is a #gsize to get the length of the data read in.cancellable is optional #GCancellable object, %NULL to ignore.a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error.read_upto_async (string stop_chars, int stop_chars_len, int io_priority, object cancellable, user_data)
The asynchronous version of g_data_input_stream_read_upto(). It is an error to have two outstanding calls to this function. In contrast to g_data_input_stream_read_until(), this function does not consume the stop character. You have to use g_data_input_stream_read_byte() to get it before calling g_data_input_stream_read_upto() again. Note that
may contain '\0' if @stop_chars_len is specified. When the operation is finished, @callback will be called. You can then call g_data_input_stream_read_upto_finish() to get the result of the operation.stop_chars is characters to terminate the read.stop_chars_len is length of @stop_chars. May be -1 if @stop_chars is nul-terminated.io_priority is the I/O priority of the request.cancellable is optional #GCancellable object, %NULL to ignore.callback is callback to call when the request is satisfied.user_data is the data to pass to callback function.None.read_upto_finish (object result)
Finish an asynchronous call started by g_data_input_stream_read_upto_async(). Note that this function does not consume the stop character. You have to use g_data_input_stream_read_byte() to get it before calling g_data_input_stream_read_upto_async() again. The returned string will always be nul-terminated on success.
result is the #GAsyncResult that was provided to the callback.length is a #gsize to get the length of the data read in.a string with the data that was read before encountering any of the stop characters. Set @length to a #gsize to get the length of the string. This function will return %NULL on an error..set_byte_order (string order)
This function sets the byte order for the given @stream. All subsequent reads from the @stream will be read in the given @order.
order is a #GDataStreamByteOrder to set..None.set_newline_type (string type)
Sets the newline type for the @stream. Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read chunk ends in "CR" we must read an additional byte to know if this is "CR" or "CR LF", and this might block if there is no more data available.
type is the type of new line return as #GDataStreamNewlineType..None.[595:14] static extends: object
Generated metadata helpers for DataInputStream class surfaces.
properties ()
Returns property metadata for
DataInputStream.
A list.