DataInputStream
Object Hierarchy:
Description:
Data input stream implements InputStream and includes functions for reading structured
data directly from a binary input stream.
Namespace: GLib
Package: gio-2.0
Content:
Properties:
Creation methods:
Methods:
-
public DataStreamByteOrder get_byte_order ()
Gets the byte order for the data input stream.
-
public DataStreamNewlineType get_newline_type ()
Gets the current newline type for the stream.
-
public uchar read_byte (Cancellable? cancellable = null) throws IOError
Reads an unsigned 8-bit/1-byte value from stream.
-
public int16 read_int16 (Cancellable? cancellable = null) throws IOError
Reads a 16-bit/2-byte value from stream.
-
public int32 read_int32 (Cancellable? cancellable = null) throws IOError
Reads a signed 32-bit/4-byte value from stream.
-
public int64 read_int64 (Cancellable? cancellable = null) throws IOError
Reads a 64-bit/8-byte value from stream.
-
public string? read_line (out size_t length, Cancellable? cancellable = null) throws IOError
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.
-
public async string? read_line_async (int io_priority = DEFAULT, Cancellable? cancellable = null, out size_t length = null) throws IOError
The asynchronous version of read_line.
It is an error to have two outstanding calls to this function.
-
public unowned string read_line_finish_utf8 (AsyncResult _result, size_t length) throws Error
-
public unowned string read_line_utf8 (size_t length, Cancellable? cancellable = null) throws Error
Reads a UTF-8 encoded line from the data input stream.
-
public uint16 read_uint16 (Cancellable? cancellable = null) throws IOError
Reads an unsigned 16-bit/2-byte value from stream.
-
public uint32 read_uint32 (Cancellable? cancellable = null) throws IOError
Reads an unsigned 32-bit/4-byte value from stream.
-
public uint64 read_uint64 (Cancellable? cancellable = null) throws IOError
Reads an unsigned 64-bit/8-byte value from stream.
-
public string? read_until (string stop_chars, out size_t length, Cancellable? cancellable = null) throws IOError
Reads a string from the data input stream, up to the first occurrence of any of the stop characters.
-
public async string? read_until_async (string stop_chars, int io_priority = DEFAULT, Cancellable? cancellable = null, out size_t? length = null) throws IOError
The asynchronous version of read_until
. It is an error to have two outstanding calls to this function.
-
public string? read_upto (string stop_chars, ssize_t stop_chars_len, out size_t length, Cancellable? cancellable = null) throws IOError
Reads a string from the data input stream, up to the first occurrence of any of the stop characters.
-
public async string? read_upto_async (string stop_chars, ssize_t stop_chars_len, int io_priority = DEFAULT, Cancellable? cancellable = null, out size_t? length = null) throws IOError
The asynchronous version of read_upto.
It is an error to have two outstanding calls to this function.
-
public void set_byte_order (DataStreamByteOrder order)
This function sets the byte order for the given stream. All subsequent reads from the
stream will be read in the given order.
-
public void set_newline_type (DataStreamNewlineType type)
Sets the newline type for the stream.