DataOutputStream

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

Constructors

this
this(GDataOutputStream* gDataOutputStream, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(OutputStream baseStream)

Creates a new data output stream for base_stream.

Members

Functions

getByteOrder
GDataStreamByteOrder getByteOrder()

Gets the byte order for the stream.

getDataOutputStreamStruct
GDataOutputStream* getDataOutputStreamStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

putByte
bool putByte(char data, Cancellable cancellable)

Puts a byte into the output stream.

putInt16
bool putInt16(short data, Cancellable cancellable)

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

putInt32
bool putInt32(int data, Cancellable cancellable)

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

putInt64
bool putInt64(long data, Cancellable cancellable)

Puts a signed 64-bit integer into the stream.

putString
bool putString(string str, Cancellable cancellable)

Puts a string into the output stream.

putUint16
bool putUint16(ushort data, Cancellable cancellable)

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

putUint32
bool putUint32(uint data, Cancellable cancellable)

Puts an unsigned 32-bit integer into the stream.

putUint64
bool putUint64(ulong data, Cancellable cancellable)

Puts an unsigned 64-bit integer into the stream.

setByteOrder
void setByteOrder(GDataStreamByteOrder order)

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

Static functions

getType
GType getType()

Variables

gDataOutputStream
GDataOutputStream* gDataOutputStream;

the main Gtk struct

Inherited Members

From FilterOutputStream

gFilterOutputStream
GFilterOutputStream* gFilterOutputStream;

the main Gtk struct

getFilterOutputStreamStruct
GFilterOutputStream* getFilterOutputStreamStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getBaseStream
OutputStream getBaseStream()

Gets the base stream for the filter stream.

getCloseBaseStream
bool getCloseBaseStream()

Returns whether the base stream will be closed when stream is closed.

setCloseBaseStream
void setCloseBaseStream(bool closeBase)

Sets whether the base stream will be closed when stream is closed.

From SeekableIF

getSeekableStruct
GSeekable* getSeekableStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
canSeek
bool canSeek()

Tests if the stream supports the GSeekableIface

canTruncate
bool canTruncate()

Tests if the length of the stream can be adjusted with g_seekable_truncate().

seek
bool seek(long offset, GSeekType type, Cancellable cancellable)

Seeks in the stream by the given offset, modified by type.

tell
long tell()

Tells the current position within the stream.

truncate
bool truncate(long offset, Cancellable cancellable)

Sets the length of the stream to offset. If the stream was previously larger than offset, the extra data is discarded. If the stream was previouly shorter than offset, it is extended with NUL ('\0') bytes.