aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-b64.c
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-02-29 22:12:59 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-02-29 22:12:59 +0800
commit39cbe68b8aba4a2839f10a4473f18954e591a5bf (patch)
treed36bc2ee1e78852871085c6381c582500d129e1e /camel/camel-stream-b64.c
parent57bf3cc473c15d3f630aa8fde4ea52e083c5bdc6 (diff)
downloadgsoc2013-evolution-39cbe68b8aba4a2839f10a4473f18954e591a5bf.tar
gsoc2013-evolution-39cbe68b8aba4a2839f10a4473f18954e591a5bf.tar.gz
gsoc2013-evolution-39cbe68b8aba4a2839f10a4473f18954e591a5bf.tar.bz2
gsoc2013-evolution-39cbe68b8aba4a2839f10a4473f18954e591a5bf.tar.lz
gsoc2013-evolution-39cbe68b8aba4a2839f10a4473f18954e591a5bf.tar.xz
gsoc2013-evolution-39cbe68b8aba4a2839f10a4473f18954e591a5bf.tar.zst
gsoc2013-evolution-39cbe68b8aba4a2839f10a4473f18954e591a5bf.zip
new utility function.
2000-02-29 bertrand <bertrand@helixcode.com> * camel-stream-b64.c (camel_stream_b64_write_to_stream): new utility function. * camel-data-wrapper.c (_write_to_stream): default implementation. svn path=/trunk/; revision=1989
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);
+ }
+
+}