Tizen 2.1 base
[platform/upstream/glib2.0.git] / docs / reference / gio / html / GMemoryOutputStream.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GMemoryOutputStream</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="streaming.html" title="Streaming I/O">
9 <link rel="prev" href="GMemoryInputStream.html" title="GMemoryInputStream">
10 <link rel="next" href="GBufferedInputStream.html" title="GBufferedInputStream">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="GMemoryInputStream.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="streaming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GIO Reference Manual</th>
21 <td><a accesskey="n" href="GBufferedInputStream.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GMemoryOutputStream.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#GMemoryOutputStream.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#GMemoryOutputStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
29                    | 
30                   <a href="#GMemoryOutputStream.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
31                    | 
32                   <a href="#GMemoryOutputStream.properties" class="shortcut">Properties</a>
33 </td></tr>
34 </table>
35 <div class="refentry">
36 <a name="GMemoryOutputStream"></a><div class="titlepage"></div>
37 <div class="refnamediv"><table width="100%"><tr>
38 <td valign="top">
39 <h2><span class="refentrytitle"><a name="GMemoryOutputStream.top_of_page"></a>GMemoryOutputStream</span></h2>
40 <p>GMemoryOutputStream — Streaming output operations on memory chunks</p>
41 </td>
42 <td valign="top" align="right"></td>
43 </tr></table></div>
44 <div class="refsynopsisdiv">
45 <a name="GMemoryOutputStream.synopsis"></a><h2>Synopsis</h2>
46 <pre class="synopsis">
47 #include &lt;gio/gio.h&gt;
48
49 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            (<a class="link" href="GMemoryOutputStream.html#GReallocFunc" title="GReallocFunc ()">*GReallocFunc</a>)                     (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
50                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);
51                     <a class="link" href="GMemoryOutputStream.html#GMemoryOutputStream-struct" title="GMemoryOutputStream">GMemoryOutputStream</a>;
52 <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-new" title="g_memory_output_stream_new ()">g_memory_output_stream_new</a>          (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
53                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
54                                                          <em class="parameter"><code><a class="link" href="GMemoryOutputStream.html#GReallocFunc" title="GReallocFunc ()"><span class="type">GReallocFunc</span></a> realloc_function</code></em>,
55                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_function</code></em>);
56 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-get-data" title="g_memory_output_stream_get_data ()">g_memory_output_stream_get_data</a>     (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);
57 <a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-get-size" title="g_memory_output_stream_get_size ()">g_memory_output_stream_get_size</a>     (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);
58 <a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-get-data-size" title="g_memory_output_stream_get_data_size ()">g_memory_output_stream_get_data_size</a>
59                                                         (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);
60 <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-steal-data" title="g_memory_output_stream_steal_data ()">g_memory_output_stream_steal_data</a>   (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);
61 </pre>
62 </div>
63 <div class="refsect1">
64 <a name="GMemoryOutputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
65 <pre class="synopsis">
66   <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
67    +----<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a>
68          +----GMemoryOutputStream
69 </pre>
70 </div>
71 <div class="refsect1">
72 <a name="GMemoryOutputStream.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
73 <p>
74 GMemoryOutputStream implements
75  <a class="link" href="GSeekable.html" title="GSeekable">GSeekable</a>.</p>
76 </div>
77 <div class="refsect1">
78 <a name="GMemoryOutputStream.properties"></a><h2>Properties</h2>
79 <pre class="synopsis">
80   "<a class="link" href="GMemoryOutputStream.html#GMemoryOutputStream--data" title='The "data" property'>data</a>"                     <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only
81   "<a class="link" href="GMemoryOutputStream.html#GMemoryOutputStream--data-size" title='The "data-size" property'>data-size</a>"                <a href="./../glib/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>                : Read
82   "<a class="link" href="GMemoryOutputStream.html#GMemoryOutputStream--destroy-function" title='The "destroy-function" property'>destroy-function</a>"         <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only
83   "<a class="link" href="GMemoryOutputStream.html#GMemoryOutputStream--realloc-function" title='The "realloc-function" property'>realloc-function</a>"         <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only
84   "<a class="link" href="GMemoryOutputStream.html#GMemoryOutputStream--size" title='The "size" property'>size</a>"                     <a href="./../glib/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>                : Read / Write / Construct Only
85 </pre>
86 </div>
87 <div class="refsect1">
88 <a name="GMemoryOutputStream.description"></a><h2>Description</h2>
89 <p>
90 <a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> is a class for using arbitrary
91 memory chunks as output for GIO streaming output operations.
92 </p>
93 </div>
94 <div class="refsect1">
95 <a name="GMemoryOutputStream.details"></a><h2>Details</h2>
96 <div class="refsect2">
97 <a name="GReallocFunc"></a><h3>GReallocFunc ()</h3>
98 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            (*GReallocFunc)                     (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
99                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);</pre>
100 <p>
101 Changes the size of the memory block pointed to by <em class="parameter"><code>data</code></em> to
102 <em class="parameter"><code>size</code></em> bytes.
103 </p>
104 <p>
105 The function should have the same semantics as <code class="function">realloc()</code>.
106 </p>
107 <div class="variablelist"><table border="0">
108 <col align="left" valign="top">
109 <tbody>
110 <tr>
111 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
112 <td>memory block to reallocate</td>
113 </tr>
114 <tr>
115 <td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
116 <td>size to reallocate <em class="parameter"><code>data</code></em> to</td>
117 </tr>
118 <tr>
119 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
120 <td>a pointer to the reallocated memory</td>
121 </tr>
122 </tbody>
123 </table></div>
124 </div>
125 <hr>
126 <div class="refsect2">
127 <a name="GMemoryOutputStream-struct"></a><h3>GMemoryOutputStream</h3>
128 <pre class="programlisting">typedef struct _GMemoryOutputStream GMemoryOutputStream;</pre>
129 <p>
130 Implements <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> for arbitrary memory chunks.
131 </p>
132 </div>
133 <hr>
134 <div class="refsect2">
135 <a name="g-memory-output-stream-new"></a><h3>g_memory_output_stream_new ()</h3>
136 <pre class="programlisting"><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     g_memory_output_stream_new          (<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
137                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
138                                                          <em class="parameter"><code><a class="link" href="GMemoryOutputStream.html#GReallocFunc" title="GReallocFunc ()"><span class="type">GReallocFunc</span></a> realloc_function</code></em>,
139                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_function</code></em>);</pre>
140 <p>
141 Creates a new <a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a>.
142 </p>
143 <p>
144 If <em class="parameter"><code>data</code></em> is non-<a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the stream  will use that for its internal storage.
145 If <em class="parameter"><code>realloc_fn</code></em> is non-<a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, it will be used for resizing the internal
146 storage when necessary. To construct a fixed-size output stream,
147 pass <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> as <em class="parameter"><code>realloc_fn</code></em>.
148 </p>
149 <p>
150 </p>
151 <div class="informalexample">
152   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
153     <tbody>
154       <tr>
155         <td class="listing_lines" align="right"><pre>1
156 2
157 3
158 4
159 5
160 6
161 7
162 8
163 9</pre></td>
164         <td class="listing_code"><pre class="programlisting"><span class="comment">/* a stream that can grow */</span>
165 <span class="normal">stream </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GMemoryOutputStream.html#g-memory-output-stream-new">g_memory_output_stream_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> realloc</span><span class="symbol">,</span><span class="normal"> free</span><span class="symbol">);</span>
166
167 <span class="comment">/* another stream that can grow */</span>
168 <span class="normal">stream2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GMemoryOutputStream.html#g-memory-output-stream-new">g_memory_output_stream_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> <a href="./../glib/glib/glib-Memory-Allocation.html#g-realloc">g_realloc</a></span><span class="symbol">,</span><span class="normal"> <a href="./../glib/glib/glib-Memory-Allocation.html#g-free">g_free</a></span><span class="symbol">);</span>
169
170 <span class="comment">/* a fixed-size stream */</span>
171 <span class="normal">data </span><span class="symbol">=</span><span class="normal"> </span><span class="function">malloc</span><span class="normal"> </span><span class="symbol">(</span><span class="number">200</span><span class="symbol">);</span>
172 <span class="normal">stream3 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GMemoryOutputStream.html#g-memory-output-stream-new">g_memory_output_stream_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">data</span><span class="symbol">,</span><span class="normal"> </span><span class="number">200</span><span class="symbol">,</span><span class="normal"> <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> free</span><span class="symbol">);</span></pre></td>
173       </tr>
174     </tbody>
175   </table>
176 </div>
177
178 <p>
179 </p>
180 <div class="variablelist"><table border="0">
181 <col align="left" valign="top">
182 <tbody>
183 <tr>
184 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
185 <td>pointer to a chunk of memory to use, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
186 </td>
187 </tr>
188 <tr>
189 <td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
190 <td>the size of <em class="parameter"><code>data</code></em>
191 </td>
192 </tr>
193 <tr>
194 <td><p><span class="term"><em class="parameter"><code>realloc_function</code></em> :</span></p></td>
195 <td>a function with <code class="function">realloc()</code> semantics (like <a href="./../glib/glib/glib-Memory-Allocation.html#g-realloc"><code class="function">g_realloc()</code></a>)
196 to be called when <em class="parameter"><code>data</code></em> needs to be grown, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
197 </td>
198 </tr>
199 <tr>
200 <td><p><span class="term"><em class="parameter"><code>destroy_function</code></em> :</span></p></td>
201 <td>a function to be called on <em class="parameter"><code>data</code></em> when the stream is
202 finalized, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
203 </td>
204 </tr>
205 <tr>
206 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
207 <td>A newly created <a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> object.</td>
208 </tr>
209 </tbody>
210 </table></div>
211 </div>
212 <hr>
213 <div class="refsect2">
214 <a name="g-memory-output-stream-get-data"></a><h3>g_memory_output_stream_get_data ()</h3>
215 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_memory_output_stream_get_data     (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);</pre>
216 <p>
217 Gets any loaded data from the <em class="parameter"><code>ostream</code></em>.
218 </p>
219 <p>
220 Note that the returned pointer may become invalid on the next
221 write or truncate operation on the stream.
222 </p>
223 <div class="variablelist"><table border="0">
224 <col align="left" valign="top">
225 <tbody>
226 <tr>
227 <td><p><span class="term"><em class="parameter"><code>ostream</code></em> :</span></p></td>
228 <td>a <a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a>
229 </td>
230 </tr>
231 <tr>
232 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
233 <td>pointer to the stream's data. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
234 </td>
235 </tr>
236 </tbody>
237 </table></div>
238 </div>
239 <hr>
240 <div class="refsect2">
241 <a name="g-memory-output-stream-get-size"></a><h3>g_memory_output_stream_get_size ()</h3>
242 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               g_memory_output_stream_get_size     (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);</pre>
243 <p>
244 Gets the size of the currently allocated data area (available from
245 <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-get-data" title="g_memory_output_stream_get_data ()"><code class="function">g_memory_output_stream_get_data()</code></a>). If the stream isn't
246 growable (no realloc was passed to <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-new" title="g_memory_output_stream_new ()"><code class="function">g_memory_output_stream_new()</code></a>) then
247 this is the maximum size of the stream and further writes
248 will return <a class="link" href="gio-GIOError.html#G-IO-ERROR-NO-SPACE:CAPS"><code class="literal">G_IO_ERROR_NO_SPACE</code></a>.
249 </p>
250 <p>
251 Note that for growable streams the returned size may become invalid on
252 the next write or truncate operation on the stream.
253 </p>
254 <p>
255 If you want the number of bytes currently written to the stream, use
256 <a class="link" href="GMemoryOutputStream.html#g-memory-output-stream-get-data-size" title="g_memory_output_stream_get_data_size ()"><code class="function">g_memory_output_stream_get_data_size()</code></a>.
257 </p>
258 <div class="variablelist"><table border="0">
259 <col align="left" valign="top">
260 <tbody>
261 <tr>
262 <td><p><span class="term"><em class="parameter"><code>ostream</code></em> :</span></p></td>
263 <td>a <a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a>
264 </td>
265 </tr>
266 <tr>
267 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
268 <td>the number of bytes allocated for the data buffer</td>
269 </tr>
270 </tbody>
271 </table></div>
272 </div>
273 <hr>
274 <div class="refsect2">
275 <a name="g-memory-output-stream-get-data-size"></a><h3>g_memory_output_stream_get_data_size ()</h3>
276 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               g_memory_output_stream_get_data_size
277                                                         (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);</pre>
278 <p>
279 Returns the number of bytes from the start up
280 to including the last byte written in the stream
281 that has not been truncated away.
282 </p>
283 <div class="variablelist"><table border="0">
284 <col align="left" valign="top">
285 <tbody>
286 <tr>
287 <td><p><span class="term"><em class="parameter"><code>ostream</code></em> :</span></p></td>
288 <td>a <a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a>
289 </td>
290 </tr>
291 <tr>
292 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
293 <td>the number of bytes written to the stream</td>
294 </tr>
295 </tbody>
296 </table></div>
297 <p class="since">Since 2.18</p>
298 </div>
299 <hr>
300 <div class="refsect2">
301 <a name="g-memory-output-stream-steal-data"></a><h3>g_memory_output_stream_steal_data ()</h3>
302 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_memory_output_stream_steal_data   (<em class="parameter"><code><a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a> *ostream</code></em>);</pre>
303 <p>
304 Gets any loaded data from the <em class="parameter"><code>ostream</code></em>. Ownership of the data
305 is transferred to the caller; when no longer needed it must be
306 freed using the free function set in <em class="parameter"><code>ostream</code></em>'s
307 <a class="link" href="GMemoryOutputStream.html#GMemoryOutputStream--destroy-function" title='The "destroy-function" property'><span class="type">"destroy-function"</span></a> property.
308 </p>
309 <p>
310 <em class="parameter"><code>ostream</code></em> must be closed before calling this function.
311 </p>
312 <div class="variablelist"><table border="0">
313 <col align="left" valign="top">
314 <tbody>
315 <tr>
316 <td><p><span class="term"><em class="parameter"><code>ostream</code></em> :</span></p></td>
317 <td>a <a class="link" href="GMemoryOutputStream.html" title="GMemoryOutputStream"><span class="type">GMemoryOutputStream</span></a>
318 </td>
319 </tr>
320 <tr>
321 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
322 <td>the stream's data. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
323 </td>
324 </tr>
325 </tbody>
326 </table></div>
327 <p class="since">Since 2.26</p>
328 </div>
329 </div>
330 <div class="refsect1">
331 <a name="GMemoryOutputStream.property-details"></a><h2>Property Details</h2>
332 <div class="refsect2">
333 <a name="GMemoryOutputStream--data"></a><h3>The <code class="literal">"data"</code> property</h3>
334 <pre class="programlisting">  "data"                     <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only</pre>
335 <p>
336 Pointer to buffer where data will be written.
337 </p>
338 <p class="since">Since 2.24</p>
339 </div>
340 <hr>
341 <div class="refsect2">
342 <a name="GMemoryOutputStream--data-size"></a><h3>The <code class="literal">"data-size"</code> property</h3>
343 <pre class="programlisting">  "data-size"                <a href="./../glib/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>                : Read</pre>
344 <p>
345 Size of data written to the buffer.
346 </p>
347 <p class="since">Since 2.24</p>
348 </div>
349 <hr>
350 <div class="refsect2">
351 <a name="GMemoryOutputStream--destroy-function"></a><h3>The <code class="literal">"destroy-function"</code> property</h3>
352 <pre class="programlisting">  "destroy-function"         <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only</pre>
353 <p>
354 Function called with the buffer as argument when the stream is destroyed.
355 </p>
356 <p class="since">Since 2.24</p>
357 </div>
358 <hr>
359 <div class="refsect2">
360 <a name="GMemoryOutputStream--realloc-function"></a><h3>The <code class="literal">"realloc-function"</code> property</h3>
361 <pre class="programlisting">  "realloc-function"         <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only</pre>
362 <p>
363 Function with realloc semantics called to enlarge the buffer.
364 </p>
365 <p class="since">Since 2.24</p>
366 </div>
367 <hr>
368 <div class="refsect2">
369 <a name="GMemoryOutputStream--size"></a><h3>The <code class="literal">"size"</code> property</h3>
370 <pre class="programlisting">  "size"                     <a href="./../glib/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>                : Read / Write / Construct Only</pre>
371 <p>
372 Current size of the data buffer.
373 </p>
374 <p class="since">Since 2.24</p>
375 </div>
376 </div>
377 <div class="refsect1">
378 <a name="GMemoryOutputStream.see-also"></a><h2>See Also</h2>
379 <a class="link" href="GMemoryInputStream.html" title="GMemoryInputStream"><span class="type">GMemoryInputStream</span></a>
380 </div>
381 </div>
382 <div class="footer">
383 <hr>
384           Generated by GTK-Doc V1.18</div>
385 </body>
386 </html>