Skip to content

Gio.DataOutputStream

class — extends FilterOutputStream, Seekable

Data output stream implements OutputStream and includes functions for writing data directly to an output stream.

Constructors

new

@classmethod
def new(cls, base_stream: OutputStream) -> DataOutputStream

Creates a new data output stream for base_stream.

Parameters:

Methods

get_byte_order

def get_byte_order(self) -> DataStreamByteOrder

Gets the byte order for the stream.

put_byte

def put_byte(self, data: int, cancellable: Cancellable | None = ...) -> bool

Puts a byte into the output stream.

Parameters:

  • data — a #guchar.
  • cancellable — optional Cancellable object, None to ignore.

put_int16

def put_int16(self, data: int, cancellable: Cancellable | None = ...) -> bool

Puts a signed 16-bit integer into the output stream.

Parameters:

  • data — a #gint16.
  • cancellable — optional Cancellable object, None to ignore.

put_int32

def put_int32(self, data: int, cancellable: Cancellable | None = ...) -> bool

Puts a signed 32-bit integer into the output stream.

Parameters:

  • data — a #gint32.
  • cancellable — optional Cancellable object, None to ignore.

put_int64

def put_int64(self, data: int, cancellable: Cancellable | None = ...) -> bool

Puts a signed 64-bit integer into the stream.

Parameters:

  • data — a #gint64.
  • cancellable — optional Cancellable object, None to ignore.

put_string

def put_string(self, str: str, cancellable: Cancellable | None = ...) -> bool

Puts a string into the output stream.

Parameters:

  • str — a string.
  • cancellable — optional Cancellable object, None to ignore.

put_uint16

def put_uint16(self, data: int, cancellable: Cancellable | None = ...) -> bool

Puts an unsigned 16-bit integer into the output stream.

Parameters:

  • data — a #guint16.
  • cancellable — optional Cancellable object, None to ignore.

put_uint32

def put_uint32(self, data: int, cancellable: Cancellable | None = ...) -> bool

Puts an unsigned 32-bit integer into the stream.

Parameters:

  • data — a #guint32.
  • cancellable — optional Cancellable object, None to ignore.

put_uint64

def put_uint64(self, data: int, cancellable: Cancellable | None = ...) -> bool

Puts an unsigned 64-bit integer into the stream.

Parameters:

  • data — a #guint64.
  • cancellable — optional Cancellable object, None to ignore.

set_byte_order

def set_byte_order(self, order: DataStreamByteOrder | int) -> None

Sets the byte order of the data output stream to order.

Parameters:

  • order — a GDataStreamByteOrder.

Properties

byte_order

byte_order: DataStreamByteOrder | int  # read/write

Determines the byte ordering that is used when writing multi-byte entities (such as integers) to the stream.