gio.BufferedOutputStream

gio.BufferedOutputStream — Buffered Output Stream

Synopsis

class gio.BufferedOutputStream(gio.FilterOutputStream):
    gio.BufferedOutputStream(base_stream)
def get_auto_grow()
def get_buffer_size()
def set_auto_grow(auto_grow)
def set_buffer_size(size)
Functions
 
    def gio.buffered_output_stream_new_sized(size)

Ancestry

+-- gobject.GObject
  +-- gio.OutputStream
    +-- gio.FilterOutputStream
      +-- gio.BufferedOutputStream

gio.BufferedOutputStream Properties

"auto-grow"Read - WriteWhether the buffer should automatically grow. Default value: False.
"buffer-size"Read - Write - ConstructThe size of the backend buffer. Allowed values: >= 1. Default value: 4096.

Description

gio.BufferedOutputStream implements gio.FilterOutputStream and provides for buffered writes.

By default, gio.BufferedOutputStream's buffer size is set at 4 kilobytes.

To create a buffered output stream, use gio.BufferedOutputStream(), or gio.buffered_output_stream_new_sized() to specify the buffer's size at construction.

To get the size of a buffer within a buffered output stream, use gio.BufferedOutputStream.get_buffer_size(). To change the size of a buffered output stream's buffer, use gio.BufferedOutputStream.set_buffer_size(). Note that the buffer's size cannot be reduced below the size of the data within the buffer.

Constructor

    gio.BufferedOutputStream(base_stream)

base_stream :

a gio.OutputStream.

Returns :

a new gio.OutputStream for the given base_stream.

Creates a new buffered output stream for a base stream.

Methods

gio.BufferedOutputStream.get_auto_grow

    def get_auto_grow()

Returns :

True if the stream's buffer automatically grows, False otherwise.

The get_auto_grow() method checks if the buffer automatically grows as data is added.

gio.BufferedOutputStream.get_buffer_size

    def get_buffer_size()

Returns :

the current buffer size.

The get_buffer_size() method gets the size of the buffer in the stream.

gio.BufferedOutputStream.set_auto_grow

    def set_auto_grow(auto_grow)

auto_grow :

a boolean.

The set_auto_grow() method sets whether or not the stream'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.

gio.BufferedOutputStream.set_buffer_size

    def set_buffer_size(size)

size :

the new buffer size.

The set_buffer_size() method sets the size of the internal buffer to size.

Functions

gio.buffered_output_stream_new_sized

    def buffered_output_stream_new_sized(size)

size :

the requested buffer size.

Returns :

A new gio.OutputStream with an internal buffer set to size..

The buffered_output_stream_new_sized() function creates a new gio.BufferedOutputStream from the given base_stream, with a buffer set to size.