Camel.Stream¶
- Subclasses:
Camel.StreamBuffer
,Camel.StreamFilter
,Camel.StreamFs
,Camel.StreamMem
,Camel.StreamNull
,Camel.StreamProcess
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The base |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Camel.Stream(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(base_stream)¶
- Parameters:
base_stream (
Gio.IOStream
) – aGio.IOStream
- Returns:
- Return type:
Creates a
Camel.Stream
as a thin wrapper for base_stream.New in version 3.12.
- close(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
0 on success or -1 on error.
- Return type:
Closes the stream.
- eos()¶
-
Tests if there are bytes left to read on the self object.
- flush(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
0 on success or -1 on fail along with setting error
- Return type:
Flushes any buffered data to the stream’s backing store. Only meaningful for writable streams.
- read(buffer, cancellable)¶
- Parameters:
buffer ([
int
]) – output buffercancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, 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.
- ref_base_stream()¶
- Returns:
a
Gio.IOStream
, orNone
- Return type:
Gio.IOStream
orNone
Returns the
Gio.IOStream
for self. This is only valid if self was created withCamel.Stream.new
(). For all otherCamel.Stream
subclasses this function returnsNone
.The returned
Gio.IOStream
is referenced for thread-safety and should be unreferenced withGObject.Object.unref
() when finished with it.New in version 3.12.
- set_base_stream(base_stream)¶
- Parameters:
base_stream (
Gio.IOStream
) – aGio.IOStream
Replaces the
Gio.IOStream
passed toCamel.Stream.new
() with base_stream. The new base_stream should wrap the originalGio.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.Cancellable
orNone
) – optionalGio.Cancellable
object, 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.
- write_string(string, cancellable)¶
- Parameters:
string (
str
) – a stringcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
the number of characters written or -1 on error.
- Return type:
Writes the string to the stream.
- write_to_stream(output_stream, cancellable)¶
- Parameters:
output_stream (
Camel.Stream
) – destinationCamel.Stream
objectcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
-1 on error, or the number of bytes successfully copied across streams.
- Return type:
Write all of a stream (until eos) into another stream, in a blocking fashion.
- do_close(cancellable) virtual¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Returns:
0 on success or -1 on error.
- Return type:
Closes the stream.
- do_eos() virtual¶
-
Tests if there are bytes left to read on the stream object.
- do_flush(cancellable) virtual¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Returns:
0 on success or -1 on fail along with setting error
- Return type:
Flushes any buffered data to the stream’s backing store. Only meaningful for writable streams.
- do_read(buffer, cancellable) virtual¶
- Parameters:
buffer ([
int
]) – output buffercancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, 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.
- do_write(buffer, cancellable) virtual¶
- Parameters:
buffer ([
int
]) – buffer to write.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, 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.
Property Details¶
- Camel.Stream.props.base_stream¶
- Name:
base-stream
- Type:
- Default Value:
- Flags:
The base
Gio.IOStream