Gio.BufferedOutputStream - Classes - Gio 2.0 (original) (raw)

g GObject.GInterface GObject.GInterface Gio.Seekable Gio.Seekable GObject.GInterface->Gio.Seekable GObject.Object GObject.Object Gio.OutputStream Gio.OutputStream GObject.Object->Gio.OutputStream Gio.BufferedOutputStream Gio.BufferedOutputStream Gio.FilterOutputStream Gio.FilterOutputStream Gio.FilterOutputStream->Gio.BufferedOutputStream Gio.OutputStream->Gio.FilterOutputStream Gio.Seekable->Gio.BufferedOutputStream

Subclasses:

None

Methods

Inherited:

Gio.FilterOutputStream (3), Gio.OutputStream (29), GObject.Object (37), Gio.Seekable (5)

Structs:

GObject.ObjectClass (5)

class new (base_stream)
class new_sized (base_stream, size)
get_auto_grow ()
get_buffer_size ()
set_auto_grow (auto_grow)
set_buffer_size (size)

Virtual Methods

Inherited:

Gio.OutputStream (15), GObject.Object (7), Gio.Seekable (5)

Properties

Inherited:

Gio.FilterOutputStream (2)

Name Type Flags Short Description
auto-grow bool r/w
buffer-size int r/w/c

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name Type Access Description
parent_instance Gio.FilterOutputStream r

Class Details

class Gio.BufferedOutputStream(**kwargs)

Bases:

Gio.FilterOutputStream, Gio.Seekable

Abstract:

No

Structure:

Gio.BufferedOutputStreamClass

Buffered output stream implements [class`Gio`.FilterOutputStream] and provides for buffered writes.

By default, GBufferedOutputStream’s buffer size is set at 4 kilobytes.

To create a buffered output stream, use [ctor`Gio`.BufferedOutputStream.new], or [ctor`Gio`.BufferedOutputStream.new_sized] to specify the buffer’s size at construction.

To get the size of a buffer within a buffered input stream, use [method`Gio`.BufferedOutputStream.get_buffer_size]. To change the size of a buffered output stream’s buffer, use [method`Gio`.BufferedOutputStream.set_buffer_size]. Note that the buffer’s size cannot be reduced below the size of the data within the buffer.

classmethod new(base_stream)[source]

Parameters:

base_stream (Gio.OutputStream) – a [class`Gio`.OutputStream].

Returns:

a [class`Gio`.OutputStream] for the given base_stream.

Return type:

Gio.OutputStream

Creates a new buffered output stream for a base stream.

classmethod new_sized(base_stream, size)[source]

Parameters:

Returns:

a [class`Gio`.OutputStream] with an internal buffer set to size.

Return type:

Gio.OutputStream

Creates a new buffered output stream with a given buffer size.

get_auto_grow()[source]

Returns:

TRUE if the self's buffer automatically grows,FALSE otherwise.

Return type:

bool

Checks if the buffer automatically grows as data is added.

get_buffer_size()[source]

Returns:

the current size of the buffer.

Return type:

int

Gets the size of the buffer in the self.

set_auto_grow(auto_grow)[source]

Parameters:

auto_grow (bool) – a bool.

Sets whether or not the self's buffer should automatically grow. If auto_grow is true, then each write will just make the buffer larger, and you must manually flush the buffer to actually write out the data to the underlying stream.

set_buffer_size(size)[source]

Parameters:

size (int) – a #gsize.

Sets the size of the internal buffer to size.

Property Details

Gio.BufferedOutputStream.props.auto_grow

Name:

auto-grow

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether the buffer should automatically grow.

Gio.BufferedOutputStream.props.buffer_size

Name:

buffer-size

Type:

int

Default Value:

4096

Flags:

READABLE, WRITABLE, CONSTRUCT

The size of the backend buffer, in bytes.