GMime.StreamMem

g GMime.Stream GMime.Stream GMime.StreamMem GMime.StreamMem GMime.Stream->GMime.StreamMem GObject.Object GObject.Object GObject.Object->GMime.Stream

Subclasses:

None

Methods

Inherited:

GMime.Stream (17), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_with_buffer (buffer)

class

new_with_byte_array (array)

get_byte_array ()

get_owner ()

set_byte_array (array)

set_owner (owner)

Virtual Methods

Inherited:

GMime.Stream (10), GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

buffer

bytes

r

a memory buffer

owner

bool

r

True if this stream owns the memory buffer

parent_object

GMime.Stream

r

parent GMime.Stream

Class Details

class GMime.StreamMem(**kwargs)
Bases:

GMime.Stream

Abstract:

No

Structure:

GMime.StreamMemClass

A memory-backed GMime.Stream.

classmethod new()
Returns:

a new memory stream.

Return type:

GMime.Stream

Creates a new GMime.StreamMem object.

classmethod new_with_buffer(buffer)
Parameters:

buffer (bytes) – stream data

Returns:

a new memory stream initialized with buffer.

Return type:

GMime.Stream

Creates a new GMime.StreamMem object and initializes the stream contents with the first len bytes of buffer.

classmethod new_with_byte_array(array)
Parameters:

array (bytes) – source data

Returns:

a new memory stream using array.

Return type:

GMime.Stream

Creates a new GMime.StreamMem with data array.

get_byte_array()
Returns:

the byte array from the memory stream.

Return type:

bytes

Gets the byte array from the memory stream.

get_owner()
Returns:

True if self owns the backend memory buffer or False otherwise.

Return type:

bool

Gets whether or not self owns the backend memory buffer.

set_byte_array(array)
Parameters:

array (bytes) – stream data

Sets the byte array on the memory stream.

Note: The memory stream is not responsible for freeing the byte array. Use GMime.StreamMem.set_owner() to change this behavior.

set_owner(owner)
Parameters:

owner (bool) – True if this stream should own the GLib.ByteArray or False otherwise

Sets whether or not self owns the backend memory buffer.

Note: owner should be True if the stream should free the backend memory buffer when destroyed or False otherwise.