aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-b64.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-stream-b64.c')
-rw-r--r--camel/camel-stream-b64.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/camel/camel-stream-b64.c b/camel/camel-stream-b64.c
index 53c708fd14..29c89ba92b 100644
--- a/camel/camel-stream-b64.c
+++ b/camel/camel-stream-b64.c
@@ -551,4 +551,24 @@ my_reset (CamelStream *stream)
+void
+camel_stream_b64_write_to_stream (CamelStream *stream,
+ CamelStream *output_stream)
+{
+ gchar tmp_buf[4096];
+ gint nb_read;
+ /*
+ * default implementation that uses the input
+ * stream and stream it in a blocking way.
+ */
+ g_assert (output_stream);
+ g_assert (stream);
+
+ while (!camel_stream_eos (output_stream)) {
+ nb_read = camel_stream_read (stream, tmp_buf, 4096);
+ if (nb_read)
+ camel_stream_write (output_stream, tmp_buf, nb_read);
+ }
+
+}