| Top |
Data output stream implements GOutputStream and includes functions for writing data directly to an output stream.
GDataOutputStream *
g_data_output_stream_new (GOutputStream *base_stream);
Creates a new data output stream for base_stream
.
void g_data_output_stream_set_byte_order (GDataOutputStream *stream,GDataStreamByteOrder order);
Sets the byte order of the data output stream to order
.
GDataStreamByteOrder
g_data_output_stream_get_byte_order (GDataOutputStream *stream);
Gets the byte order for the stream.
gboolean g_data_output_stream_put_byte (GDataOutputStream *stream,guchar data,GCancellable *cancellable,GError **error);
Puts a byte into the output stream.
stream |
||
data |
a guchar. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
gboolean g_data_output_stream_put_int16 (GDataOutputStream *stream,gint16 data,GCancellable *cancellable,GError **error);
Puts a signed 16-bit integer into the output stream.
stream |
||
data |
a gint16. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
gboolean g_data_output_stream_put_uint16 (GDataOutputStream *stream,guint16 data,GCancellable *cancellable,GError **error);
Puts an unsigned 16-bit integer into the output stream.
stream |
||
data |
a guint16. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
gboolean g_data_output_stream_put_int32 (GDataOutputStream *stream,gint32 data,GCancellable *cancellable,GError **error);
Puts a signed 32-bit integer into the output stream.
stream |
||
data |
a gint32. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
gboolean g_data_output_stream_put_uint32 (GDataOutputStream *stream,guint32 data,GCancellable *cancellable,GError **error);
Puts an unsigned 32-bit integer into the stream.
stream |
||
data |
a guint32. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
gboolean g_data_output_stream_put_int64 (GDataOutputStream *stream,gint64 data,GCancellable *cancellable,GError **error);
Puts a signed 64-bit integer into the stream.
stream |
||
data |
a gint64. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
gboolean g_data_output_stream_put_uint64 (GDataOutputStream *stream,guint64 data,GCancellable *cancellable,GError **error);
Puts an unsigned 64-bit integer into the stream.
stream |
||
data |
a guint64. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
gboolean g_data_output_stream_put_string (GDataOutputStream *stream,const char *str,GCancellable *cancellable,GError **error);
Puts a string into the output stream.
stream |
||
str |
a string. |
|
cancellable |
optional GCancellable object, |
[nullable] |
error |
struct GDataOutputStream;
An implementation of GBufferedOutputStream that allows for high-level data manipulation of arbitrary data (including binary operations).
“byte-order” property“byte-order” GDataStreamByteOrder
Determines the byte ordering that is used when writing multi-byte entities (such as integers) to the stream.
Flags: Read / Write
Default value: G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN