Camel.Stream¶
| Subclasses: | Camel.StreamBuffer,Camel.StreamFilter,Camel.StreamFs,Camel.StreamMem,Camel.StreamNull,Camel.StreamProcess | 
|---|
Methods¶
| Inherited: | GObject.Object (37), Gio.Seekable (5) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(base_stream) | 
| close(cancellable) | |
| eos() | |
| flush(cancellable) | |
| read(buffer, cancellable) | |
| ref_base_stream() | |
| set_base_stream(base_stream) | |
| write(buffer, cancellable) | |
| write_string(string, cancellable) | |
| write_to_stream(output_stream, cancellable) | 
Virtual Methods¶
| Inherited: | GObject.Object (7), Gio.Seekable (5) | 
|---|
| do_close(cancellable) | |
| do_eos() | |
| do_flush(cancellable) | |
| do_read(buffer, cancellable) | |
| do_write(buffer, cancellable) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| base-stream | Gio.IOStream | r/w/en | The base Gio.IOStream | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Camel.Stream(**kwargs)¶
- Bases: - GObject.Object,- Gio.Seekable- Abstract: - No - Structure: - Camel.StreamClass- 
classmethod new(base_stream)¶
- Parameters: - base_stream ( - Gio.IOStream) – a- Gio.IOStream- Returns: - a - Camel.Stream- Return type: - Camel.Stream- Creates a - Camel.Streamas a thin wrapper for base_stream.- New in version 3.12. 
 - 
close(cancellable)¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Raises: - GLib.Error- Returns: - 0 on success or -1 on error. - Return type: - int- Closes the stream. 
 - 
eos()¶
- Returns: - Trueon EOS or- Falseotherwise.- Return type: - bool- Tests if there are bytes left to read on the self object. 
 - 
flush(cancellable)¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Raises: - GLib.Error- Returns: - 0 on success or -1 on fail along with setting error - Return type: - int- Flushes any buffered data to the stream’s backing store. Only meaningful for writable streams. 
 - 
read(buffer, cancellable)¶
- Parameters: - buffer ([int]) – output buffer
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - the number of bytes actually read, or -1 on error and set errno. - Return type: - Attempts to read up to n bytes from self into buffer. 
- buffer ([
 - 
ref_base_stream()¶
- Returns: - a - Gio.IOStream, or- None- Return type: - Gio.IOStreamor- None- Returns the - Gio.IOStreamfor self. This is only valid if self was created with- Camel.Stream.new(). For all other- Camel.Streamsubclasses this function returns- None.- The returned - Gio.IOStreamis referenced for thread-safety and should be unreferenced with- GObject.Object.unref() when finished with it.- New in version 3.12. 
 - 
set_base_stream(base_stream)¶
- Parameters: - base_stream ( - Gio.IOStream) – a- Gio.IOStream- Replaces the - Gio.IOStreampassed to- Camel.Stream.new() with base_stream. The new base_stream should wrap the original- Gio.IOStream, such as when adding Transport Layer Security after issuing a STARTTLS command.- New in version 3.12. 
 - 
write(buffer, cancellable)¶
- Parameters: - buffer ([int]) – buffer to write.
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - the number of bytes written to the stream, or -1 on error along with setting errno. - Return type: - Attempts to write up to n bytes of buffer into self. 
- buffer ([
 - 
write_string(string, cancellable)¶
- Parameters: - string (str) – a string
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - the number of characters written or -1 on error. - Return type: - Writes the string to the stream. 
- string (
 - 
write_to_stream(output_stream, cancellable)¶
- Parameters: - output_stream (Camel.Stream) – destinationCamel.Streamobject
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - -1 on error, or the number of bytes succesfully copied across streams. - Return type: - Write all of a stream (until eos) into another stream, in a blocking fashion. 
- output_stream (
 - 
do_close(cancellable) virtual¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Returns: - 0 on success or -1 on error. - Return type: - int- Closes the stream. 
 - 
do_eos() virtual¶
- Returns: - Trueon EOS or- Falseotherwise.- Return type: - bool- Tests if there are bytes left to read on the stream object. 
 - 
do_flush(cancellable) virtual¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Returns: - 0 on success or -1 on fail along with setting error - Return type: - int- Flushes any buffered data to the stream’s backing store. Only meaningful for writable streams. 
 - 
do_read(buffer, cancellable) virtual¶
- Parameters: - buffer ([int]) – output buffer
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - the number of bytes actually read, or -1 on error and set errno. - Return type: - Attempts to read up to n bytes from stream into buffer. 
- buffer ([
 - 
do_write(buffer, cancellable) virtual¶
- Parameters: - buffer ([int]) – buffer to write.
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - the number of bytes written to the stream, or -1 on error along with setting errno. - Return type: - Attempts to write up to n bytes of buffer into stream. 
- buffer ([
 
- 
classmethod 
Property Details¶
- 
Camel.Stream.props.base_stream¶
- Name: - base-stream- Type: - Gio.IOStream- Default Value: - None- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The base - Gio.IOStream