<refentry id="camel-CamelStreamMem">
<refmeta>
<refentrytitle role="top_of_page" id="camel-CamelStreamMem.top_of_page">CamelStreamMem</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAMEL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>CamelStreamMem</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="camel-CamelStreamMem.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
struct              <link linkend="CamelStreamMem">CamelStreamMem</link>;
<link linkend="CamelStream">CamelStream</link> *       <link linkend="camel-stream-mem-new">camel_stream_mem_new</link>                (void);
<link linkend="CamelStream">CamelStream</link> *       <link linkend="camel-stream-mem-new-with-byte-array">camel_stream_mem_new_with_byte_array</link>
                                                        (<link linkend="GByteArray">GByteArray</link> *buffer);
<link linkend="CamelStream">CamelStream</link> *       <link linkend="camel-stream-mem-new-with-buffer">camel_stream_mem_new_with_buffer</link>    (const <link linkend="char">char</link> *buffer,
                                                         <link linkend="size-t">size_t</link> len);
<link linkend="void">void</link>                <link linkend="camel-stream-mem-set-secure">camel_stream_mem_set_secure</link>         (<link linkend="CamelStreamMem">CamelStreamMem</link> *mem);
<link linkend="void">void</link>                <link linkend="camel-stream-mem-set-byte-array">camel_stream_mem_set_byte_array</link>     (<link linkend="CamelStreamMem">CamelStreamMem</link> *mem,
                                                         <link linkend="GByteArray">GByteArray</link> *buffer);
<link linkend="void">void</link>                <link linkend="camel-stream-mem-set-buffer">camel_stream_mem_set_buffer</link>         (<link linkend="CamelStreamMem">CamelStreamMem</link> *mem,
                                                         const <link linkend="char">char</link> *buffer,
                                                         <link linkend="size-t">size_t</link> len);
</synopsis>
</refsynopsisdiv>









<refsect1 id="camel-CamelStreamMem.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="camel-CamelStreamMem.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelStreamMem" role="struct">
<title>struct CamelStreamMem</title>
<indexterm zone="CamelStreamMem"><primary sortas="CamelStreamMem">CamelStreamMem</primary></indexterm><programlisting>struct CamelStreamMem {
	CamelSeekableStream parent_object;

	unsigned int owner:1;	/* do we own the buffer? */
	unsigned int secure:1;	/* do we clear the buffer on finalise (if we own it) */
	GByteArray *buffer;
};
</programlisting>
<para>
</para></refsect2>
<refsect2 id="camel-stream-mem-new" role="function">
<title>camel_stream_mem_new ()</title>
<indexterm zone="camel-stream-mem-new"><primary sortas="camel_stream_mem_new">camel_stream_mem_new</primary></indexterm><programlisting><link linkend="CamelStream">CamelStream</link> *       camel_stream_mem_new                (void);</programlisting>
<para>
Create a new <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link> object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-stream-mem-new-with-byte-array" role="function">
<title>camel_stream_mem_new_with_byte_array ()</title>
<indexterm zone="camel-stream-mem-new-with-byte-array"><primary sortas="camel_stream_mem_new_with_byte_array">camel_stream_mem_new_with_byte_array</primary></indexterm><programlisting><link linkend="CamelStream">CamelStream</link> *       camel_stream_mem_new_with_byte_array
                                                        (<link linkend="GByteArray">GByteArray</link> *buffer);</programlisting>
<para>
Create a new <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link> using <parameter>buffer</parameter> as the stream data.
</para>
<para>
Note: The newly created <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link> will destroy <parameter>buffer</parameter>
when destroyed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GByteArray"><type>GByteArray</type></link> to use as the stream data
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-stream-mem-new-with-buffer" role="function">
<title>camel_stream_mem_new_with_buffer ()</title>
<indexterm zone="camel-stream-mem-new-with-buffer"><primary sortas="camel_stream_mem_new_with_buffer">camel_stream_mem_new_with_buffer</primary></indexterm><programlisting><link linkend="CamelStream">CamelStream</link> *       camel_stream_mem_new_with_buffer    (const <link linkend="char">char</link> *buffer,
                                                         <link linkend="size-t">size_t</link> len);</programlisting>
<para>
Create a new memory stream using <parameter>buffer</parameter> as the stream data.
</para>
<para>
Note: <parameter>buffer</parameter> will be copied into an internal <link linkend="GByteArray"><type>GByteArray</type></link> structure
for use as the stream backing. This may have resource implications
you may wish to consider.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a memory buffer to use as the stream data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-stream-mem-set-secure" role="function">
<title>camel_stream_mem_set_secure ()</title>
<indexterm zone="camel-stream-mem-set-secure"><primary sortas="camel_stream_mem_set_secure">camel_stream_mem_set_secure</primary></indexterm><programlisting><link linkend="void">void</link>                camel_stream_mem_set_secure         (<link linkend="CamelStreamMem">CamelStreamMem</link> *mem);</programlisting>
<para>
Mark the memory stream as secure.  At the very least this means the
data in the buffer will be cleared when the buffer is finalised.
This only applies to buffers owned by the stream.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mem</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-stream-mem-set-byte-array" role="function">
<title>camel_stream_mem_set_byte_array ()</title>
<indexterm zone="camel-stream-mem-set-byte-array"><primary sortas="camel_stream_mem_set_byte_array">camel_stream_mem_set_byte_array</primary></indexterm><programlisting><link linkend="void">void</link>                camel_stream_mem_set_byte_array     (<link linkend="CamelStreamMem">CamelStreamMem</link> *mem,
                                                         <link linkend="GByteArray">GByteArray</link> *buffer);</programlisting>
<para>
Set <parameter>buffer</parameter> to be the backing data to the existing <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link>, <parameter>mem</parameter>.
</para>
<para>
Note: <parameter>mem</parameter> will not take ownership of <parameter>buffer</parameter> and so will need to
be freed separately from <parameter>mem</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mem</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GByteArray"><type>GByteArray</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-stream-mem-set-buffer" role="function">
<title>camel_stream_mem_set_buffer ()</title>
<indexterm zone="camel-stream-mem-set-buffer"><primary sortas="camel_stream_mem_set_buffer">camel_stream_mem_set_buffer</primary></indexterm><programlisting><link linkend="void">void</link>                camel_stream_mem_set_buffer         (<link linkend="CamelStreamMem">CamelStreamMem</link> *mem,
                                                         const <link linkend="char">char</link> *buffer,
                                                         <link linkend="size-t">size_t</link> len);</programlisting>
<para>
Set <parameter>buffer</parameter> to be the backing data to the existing <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link>, <parameter>mem</parameter>.
</para>
<para>
Note: <parameter>buffer</parameter> will be copied into an internal <link linkend="GByteArray"><type>GByteArray</type></link> structure
and so may have resource implications to consider.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mem</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelStreamMem"><type>CamelStreamMem</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a memory buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
