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.Streamas a thin wrapper for base_stream.New in version 3.12.
- close(cancellable)¶
 - Parameters:
 cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, 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.CancellableorNone) – optionalGio.Cancellableobject, 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.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.
- ref_base_stream()¶
 - Returns:
 a
Gio.IOStream, orNone- Return type:
 Gio.IOStreamorNone
Returns the
Gio.IOStreamfor self. This is only valid if self was created withCamel.Stream.new(). For all otherCamel.Streamsubclasses this function returnsNone.The returned
Gio.IOStreamis 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.IOStreampassed 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.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.
- write_string(string, cancellable)¶
 - Parameters:
 string (
str) – a stringcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, 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.Streamobjectcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, 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.CancellableorNone) – optionalGio.Cancellableobject, 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.CancellableorNone) – optionalGio.Cancellableobject, 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.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.
- 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.
Property Details¶
- Camel.Stream.props.base_stream¶
 - Name:
 base-stream- Type:
 - Default Value:
 - Flags:
 
The base
Gio.IOStream