|  |  |  | Camel Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
struct CamelStream; gssize camel_stream_read (CamelStream *stream,gchar *buffer,gsize n,GCancellable *cancellable,GError **error); gssize camel_stream_write (CamelStream *stream,const gchar *buffer,gsize n,GCancellable *cancellable,GError **error); gint camel_stream_flush (CamelStream *stream,GCancellable *cancellable,GError **error); gint camel_stream_close (CamelStream *stream,GCancellable *cancellable,GError **error); gboolean camel_stream_eos (CamelStream *stream); gint camel_stream_reset (CamelStream *stream,GError **error); gssize camel_stream_write_string (CamelStream *stream,const gchar *string,GCancellable *cancellable,GError **error); gssize camel_stream_printf (CamelStream *stream,const gchar *fmt,...); gssize camel_stream_vprintf (CamelStream *stream,const gchar *fmt,va_list ap); gssize camel_stream_write_to_stream (CamelStream *stream,CamelStream *output_stream,GCancellable *cancellable,GError **error);
GObject +----CamelObject +----CamelStream +----CamelHttpStream +----CamelStreamBuffer +----CamelStreamFilter +----CamelStreamFs +----CamelStreamMem +----CamelStreamNull +----CamelStreamProcess +----CamelStreamVFS +----CamelTcpStream
gssize camel_stream_read (CamelStream *stream,gchar *buffer,gsize n,GCancellable *cancellable,GError **error);
Attempts to read up to len bytes from stream into buf.
| 
 | a CamelStream object. | 
| 
 | output buffer | 
| 
 | max number of bytes to read. | 
| 
 | optional GCancellable object, or NULL | 
| 
 | return location for a GError, or NULL | 
| Returns : | the number of bytes actually read, or -1on error and set
errno. | 
gssize camel_stream_write (CamelStream *stream,const gchar *buffer,gsize n,GCancellable *cancellable,GError **error);
Attempts to write up to n bytes of buffer into stream.
| 
 | a CamelStream object | 
| 
 | buffer to write. | 
| 
 | number of bytes to write | 
| 
 | optional GCancellable object, or NULL | 
| 
 | return location for a GError, or NULL | 
| Returns : | the number of bytes written to the stream, or -1on error
along with setting errno. | 
gint camel_stream_flush (CamelStream *stream,GCancellable *cancellable,GError **error);
Flushes any buffered data to the stream's backing store. Only meaningful for writable streams.
| 
 | a CamelStream object | 
| 
 | optional GCancellable object, or NULL | 
| 
 | return location for a GError, or NULL | 
| Returns : | 0on success or-1on fail along with settingerror | 
gint camel_stream_close (CamelStream *stream,GCancellable *cancellable,GError **error);
Closes the stream.
| 
 | a CamelStream object | 
| 
 | optional GCancellable object, or NULL | 
| 
 | return location for a GError, or NULL | 
| Returns : | 0on success or-1on error. | 
gboolean            camel_stream_eos                    (CamelStream *stream);
Tests if there are bytes left to read on the stream object.
| 
 | a CamelStream object | 
| Returns : | TRUEon EOS orFALSEotherwise. | 
gint camel_stream_reset (CamelStream *stream,GError **error);
Resets the stream. That is, put it in a state where it can be read from the beginning again. Not all streams in Camel are seekable, but they must all be resettable.
| 
 | a CamelStream object | 
| 
 | return location for a GError, or NULL | 
| Returns : | 0on success or-1on error along with settingerror. | 
gssize camel_stream_write_string (CamelStream *stream,const gchar *string,GCancellable *cancellable,GError **error);
Writes the string to the stream.
| 
 | a CamelStream object | 
| 
 | a string | 
| 
 | return location for a GError, or NULL | 
| Returns : | the number of characters written or -1on error. | 
gssize camel_stream_printf (CamelStream *stream,const gchar *fmt,...);
Write formatted output to a stream.
| 
 | a CamelStream object | 
| 
 | a printf-style format string | 
| Returns : | the number of characters written or -1on error. | 
gssize camel_stream_vprintf (CamelStream *stream,const gchar *fmt,va_list ap);
gssize camel_stream_write_to_stream (CamelStream *stream,CamelStream *output_stream,GCancellable *cancellable,GError **error);
Write all of a stream (until eos) into another stream, in a blocking fashion.
| 
 | source CamelStream object | 
| 
 | destination CamelStream object | 
| 
 | optional GCancellable object, or NULL | 
| 
 | return location for a GError, or NULL | 
| Returns : | -1on error, or the number of bytes succesfully
copied across streams. |