~attente/glib/gicon-upstream

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GBufferedOutputStream</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="streaming.html" title="Streaming I/O">
<link rel="prev" href="GBufferedInputStream.html" title="GBufferedInputStream">
<link rel="next" href="GDataInputStream.html" title="GDataInputStream">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GBufferedInputStream.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="streaming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="GDataInputStream.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GBufferedOutputStream.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#GBufferedOutputStream.description" class="shortcut">Description</a>
                   | 
                  <a href="#GBufferedOutputStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#GBufferedOutputStream.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#GBufferedOutputStream.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry">
<a name="GBufferedOutputStream"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GBufferedOutputStream.top_of_page"></a>GBufferedOutputStream</span></h2>
<p>GBufferedOutputStream — Buffered Output Stream</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GBufferedOutputStream.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gio/gio.h&gt;

                    <a class="link" href="GBufferedOutputStream.html#GBufferedOutputStream-struct" title="GBufferedOutputStream">GBufferedOutputStream</a>;
<a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-new" title="g_buffered_output_stream_new ()">g_buffered_output_stream_new</a>        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *base_stream</code></em>);
<a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-new-sized" title="g_buffered_output_stream_new_sized ()">g_buffered_output_stream_new_sized</a>  (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *base_stream</code></em>,
                                                         <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);
<a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-get-buffer-size" title="g_buffered_output_stream_get_buffer_size ()">g_buffered_output_stream_get_buffer_size</a>
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-set-buffer-size" title="g_buffered_output_stream_set_buffer_size ()">g_buffered_output_stream_set_buffer_size</a>
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>,
                                                         <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);
<a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-get-auto-grow" title="g_buffered_output_stream_get_auto_grow ()">g_buffered_output_stream_get_auto_grow</a>
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-set-auto-grow" title="g_buffered_output_stream_set_auto_grow ()">g_buffered_output_stream_set_auto_grow</a>
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>,
                                                         <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> auto_grow</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GBufferedOutputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----<a class="link" href="GOutputStream.html" title="GOutputStream">GOutputStream</a>
         +----<a class="link" href="GFilterOutputStream.html" title="GFilterOutputStream">GFilterOutputStream</a>
               +----GBufferedOutputStream
</pre>
</div>
<div class="refsect1">
<a name="GBufferedOutputStream.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GBufferedOutputStream implements
 <a class="link" href="GSeekable.html" title="GSeekable">GSeekable</a>.</p>
</div>
<div class="refsect1">
<a name="GBufferedOutputStream.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="GBufferedOutputStream.html#GBufferedOutputStream--auto-grow" title='The "auto-grow" property'>auto-grow</a>"                <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write
  "<a class="link" href="GBufferedOutputStream.html#GBufferedOutputStream--buffer-size" title='The "buffer-size" property'>buffer-size</a>"              <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct
</pre>
</div>
<div class="refsect1">
<a name="GBufferedOutputStream.description"></a><h2>Description</h2>
<p>
Buffered output stream implements <a class="link" href="GFilterOutputStream.html" title="GFilterOutputStream"><span class="type">GFilterOutputStream</span></a> and provides 
for buffered writes. 
</p>
<p>
By default, <a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a>'s buffer size is set at 4 kilobytes.
</p>
<p>
To create a buffered output stream, use <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-new" title="g_buffered_output_stream_new ()"><code class="function">g_buffered_output_stream_new()</code></a>, 
or <a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-new-sized" title="g_buffered_output_stream_new_sized ()"><code class="function">g_buffered_output_stream_new_sized()</code></a> to specify the buffer's size 
at construction.
</p>
<p>
To get the size of a buffer within a buffered input stream, use 
<a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-get-buffer-size" title="g_buffered_output_stream_get_buffer_size ()"><code class="function">g_buffered_output_stream_get_buffer_size()</code></a>. To change the size of a 
buffered output stream's buffer, use 
<a class="link" href="GBufferedOutputStream.html#g-buffered-output-stream-set-buffer-size" title="g_buffered_output_stream_set_buffer_size ()"><code class="function">g_buffered_output_stream_set_buffer_size()</code></a>. Note that the buffer's 
size cannot be reduced below the size of the data within the buffer.
</p>
</div>
<div class="refsect1">
<a name="GBufferedOutputStream.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GBufferedOutputStream-struct"></a><h3>GBufferedOutputStream</h3>
<pre class="programlisting">typedef struct _GBufferedOutputStream GBufferedOutputStream;</pre>
<p>
An implementation of <a class="link" href="GFilterOutputStream.html" title="GFilterOutputStream"><span class="type">GFilterOutputStream</span></a> with a sized buffer.
</p>
</div>
<hr>
<div class="refsect2">
<a name="g-buffered-output-stream-new"></a><h3>g_buffered_output_stream_new ()</h3>
<pre class="programlisting"><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     g_buffered_output_stream_new        (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *base_stream</code></em>);</pre>
<p>
Creates a new buffered output stream for a base stream.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_stream</code></em> :</span></p></td>
<td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> for the given <em class="parameter"><code>base_stream</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-buffered-output-stream-new-sized"></a><h3>g_buffered_output_stream_new_sized ()</h3>
<pre class="programlisting"><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="returnvalue">GOutputStream</span></a> *     g_buffered_output_stream_new_sized  (<em class="parameter"><code><a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> *base_stream</code></em>,
                                                         <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);</pre>
<p>
Creates a new buffered output stream with a given buffer size.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_stream</code></em> :</span></p></td>
<td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td>a <a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a> with an internal buffer set to <em class="parameter"><code>size</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-buffered-output-stream-get-buffer-size"></a><h3>g_buffered_output_stream_get_buffer_size ()</h3>
<pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>               g_buffered_output_stream_get_buffer_size
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>);</pre>
<p>
Gets the size of the buffer in the <em class="parameter"><code>stream</code></em>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
<td>a <a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the current size of the buffer.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-buffered-output-stream-set-buffer-size"></a><h3>g_buffered_output_stream_set_buffer_size ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_buffered_output_stream_set_buffer_size
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>,
                                                         <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);</pre>
<p>
Sets the size of the internal buffer to <em class="parameter"><code>size</code></em>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
<td>a <a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td>a <a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-buffered-output-stream-get-auto-grow"></a><h3>g_buffered_output_stream_get_auto_grow ()</h3>
<pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_buffered_output_stream_get_auto_grow
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>);</pre>
<p>
Checks if the buffer automatically grows as data is added.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
<td>a <a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <em class="parameter"><code>stream</code></em>'s buffer automatically grows,
<a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-buffered-output-stream-set-auto-grow"></a><h3>g_buffered_output_stream_set_auto_grow ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_buffered_output_stream_set_auto_grow
                                                        (<em class="parameter"><code><a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a> *stream</code></em>,
                                                         <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> auto_grow</code></em>);</pre>
<p>
Sets whether or not the <em class="parameter"><code>stream</code></em>'s buffer should automatically grow.
If <em class="parameter"><code>auto_grow</code></em> is true, then each write will just make the buffer
larger, and you must manually flush the buffer to actually write out
the data to the underlying stream.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
<td>a <a class="link" href="GBufferedOutputStream.html" title="GBufferedOutputStream"><span class="type">GBufferedOutputStream</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>auto_grow</code></em> :</span></p></td>
<td>a <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="GBufferedOutputStream.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GBufferedOutputStream--auto-grow"></a><h3>The <code class="literal">"auto-grow"</code> property</h3>
<pre class="programlisting">  "auto-grow"                <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write</pre>
<p>Whether the buffer should automatically grow.</p>
<p>Default value: FALSE</p>
</div>
<hr>
<div class="refsect2">
<a name="GBufferedOutputStream--buffer-size"></a><h3>The <code class="literal">"buffer-size"</code> property</h3>
<pre class="programlisting">  "buffer-size"              <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write / Construct</pre>
<p>The size of the backend buffer.</p>
<p>Allowed values: &gt;= 1</p>
<p>Default value: 4096</p>
</div>
</div>
<div class="refsect1">
<a name="GBufferedOutputStream.see-also"></a><h2>See Also</h2>
<a class="link" href="GFilterOutputStream.html" title="GFilterOutputStream"><span class="type">GFilterOutputStream</span></a>, <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>