| GIO Reference Manual | ||||
|---|---|---|---|---|
#include <gio/gio.h>
GDataOutputStream;
GDataOutputStream* g_data_output_stream_new (GOutputStream *base_stream);
void g_data_output_stream_set_byte_order (GDataOutputStream *stream,
GDataStreamByteOrder order);
GDataStreamByteOrder g_data_output_stream_get_byte_order
(GDataOutputStream *stream);
gboolean g_data_output_stream_put_byte (GDataOutputStream *stream,
guchar data,
GCancellable *cancellable,
GError **error);
gboolean g_data_output_stream_put_int16 (GDataOutputStream *stream,
gint16 data,
GCancellable *cancellable,
GError **error);
gboolean g_data_output_stream_put_uint16 (GDataOutputStream *stream,
guint16 data,
GCancellable *cancellable,
GError **error);
gboolean g_data_output_stream_put_int32 (GDataOutputStream *stream,
gint32 data,
GCancellable *cancellable,
GError **error);
gboolean g_data_output_stream_put_uint32 (GDataOutputStream *stream,
guint32 data,
GCancellable *cancellable,
GError **error);
gboolean g_data_output_stream_put_int64 (GDataOutputStream *stream,
gint64 data,
GCancellable *cancellable,
GError **error);
gboolean g_data_output_stream_put_uint64 (GDataOutputStream *stream,
guint64 data,
GCancellable *cancellable,
GError **error);
gboolean g_data_output_stream_put_string (GDataOutputStream *stream,
const char *str,
GCancellable *cancellable,
GError **error);
Data output stream implements GOutputStream and includes functions for writing data directly to an output stream.
typedef struct _GDataOutputStream GDataOutputStream;
An implementation of GBufferedOutputStream that allows for high-level data manipulation of arbitrary data (including binary operations).
GDataOutputStream* g_data_output_stream_new (GOutputStream *base_stream);
Creates a new data output stream for base_stream.
|
a GOutputStream. |
Returns : |
GDataOutputStream. |
void g_data_output_stream_set_byte_order (GDataOutputStream *stream, GDataStreamByteOrder order);
Sets the byte order of the data output stream to order.
|
a GDataOutputStream. |
|
a GDataStreamByteOrder.
|
GDataStreamByteOrder g_data_output_stream_get_byte_order (GDataOutputStream *stream);
Gets the byte order for the stream.
|
a GDataOutputStream. |
Returns : |
the GDataStreamByteOrder 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.
|
a GDataOutputStream. |
|
a guchar. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if data was successfully added to the stream.
|
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.
|
a GDataOutputStream. |
|
a gint16. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if data was successfully added to the stream.
|
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.
|
a GDataOutputStream. |
|
a guint16. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if data was successfully added to the stream.
|
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.
|
a GDataOutputStream. |
|
a gint32. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if data was successfully added to the stream.
|
gboolean g_data_output_stream_put_uint32 (GDataOutputStream *stream, guint32 data, GCancellable *cancellable, GError **error);
Puts an unsigned 32-bit integer into the stream.
|
a GDataOutputStream. |
|
a guint32. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if data was successfully added to the stream.
|
gboolean g_data_output_stream_put_int64 (GDataOutputStream *stream, gint64 data, GCancellable *cancellable, GError **error);
Puts a signed 64-bit integer into the stream.
|
a GDataOutputStream. |
|
a gint64. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if data was successfully added to the stream.
|
gboolean g_data_output_stream_put_uint64 (GDataOutputStream *stream, guint64 data, GCancellable *cancellable, GError **error);
Puts an unsigned 64-bit integer into the stream.
|
a GDataOutputStream. |
|
a guint64. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if data was successfully added to the stream.
|
gboolean g_data_output_stream_put_string (GDataOutputStream *stream, const char *str, GCancellable *cancellable, GError **error);
Puts a string into the output stream.
|
a GDataOutputStream. |
|
a string. |
|
optional GCancellable object, NULL to ignore.
|
|
a GError, NULL to ignore.
|
Returns : |
TRUE if string was successfully added to the stream.
|
"byte-order" property"byte-order" GDataStreamByteOrder : Read / Write
Determines the byte ordering that is used when writing multi-byte entities (such as integers) to the stream.
Default value: G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN