/usr/share/gtk-doc/html/pygobject/class-giobufferedinputstream.html is in python-gobject-2-dev 2.28.6-12build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gio.BufferedInputStream</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="PyGObject Reference Manual"><link rel="up" href="gio-class-reference.html" title="PyGio Class Reference"><link rel="prev" href="class-gioasyncresult.html" title="gio.AsyncResult"><link rel="next" href="class-giobufferedoutputstream.html" title="gio.BufferedOutputStream"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gio.BufferedInputStream</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gioasyncresult.html">Prev</a> </td><th width="60%" align="center">PyGio Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-giobufferedoutputstream.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gio.BufferedInputStream"><a name="class-giobufferedinputstream"></a><div class="titlepage"></div><div class="refnamediv"><h2>gio.BufferedInputStream</h2><p>gio.BufferedInputStream — Buffered Input Stream</p></div><div class="refsect1" title="Synopsis"><a name="id449200"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gio.BufferedInputStream</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-giofilterinputstream.html" title="gio.FilterInputStream">gio.FilterInputStream</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#constructor-giobufferedinputstream" title="Constructor">gio.BufferedInputStream</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>base_stream</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--fill" title="gio.BufferedInputStream.fill">fill</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>count</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--fill-async" title="gio.BufferedInputStream.fill_async">fill_async</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>count</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>io_priority</code></strong></span><span class="initializer">=glib.PRIORITY_DEFAULT</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--fill-finish" title="gio.BufferedInputStream.fill_finish">fill_finish</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>result</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--get-available" title="gio.BufferedInputStream.get_available">get_available</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--get-buffer-size" title="gio.BufferedInputStream.get_buffer_size">get_buffer_size</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--read-byte" title="gio.BufferedInputStream.read_byte">read_byte</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--set-buffer-size" title="gio.BufferedInputStream.set_buffer_size">set_buffer_size</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>size</code></strong></span></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-giobufferedinputstream.html#function-gio--buffered-input-stream-new-sized" title="gio.buffered_input_stream_new_sized">gio.buffered_input_stream_new_sized</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>size</code></strong></span></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id448121"></a><h2>Ancestry</h2><pre class="synopsis">+-- <a class="link" href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a class="link" href="class-gioinputstream.html" title="gio.InputStream">gio.InputStream</a>
+-- <a class="link" href="class-giofilterinputstream.html" title="gio.FilterInputStream">gio.FilterInputStream</a>
+-- <a class="link" href="class-giobufferedinputstream.html" title="gio.BufferedInputStream">gio.BufferedInputStream</a>
</pre></div><div class="refsect1" title="gio.BufferedInputStream Properties"><a name="properties-giobufferedinputstream"></a><h2>gio.BufferedInputStream Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"buffer-size"</td><td valign="top">Read - Write - Construct</td><td valign="top">The size of the backend buffer. Allowed values: >= 1. Default value: 4096.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="Description"><a name="id500482"></a><h2>Description</h2><p>
<a class="link" href="class-giobufferedinputstream.html" title="gio.BufferedInputStream"><code class="classname">gio.BufferedInputStream</code></a>
implements <a class="link" href="class-giofilterinputstream.html" title="gio.FilterInputStream"><code class="classname">gio.FilterInputStream</code></a>
and provides for buffered reads.
</p><p>
By default,
<a class="link" href="class-giobufferedinputstream.html" title="gio.BufferedInputStream"><code class="classname">gio.BufferedInputStream</code></a>'s
buffer size is set at 4 kilobytes.
</p><p>
To create a buffered input stream, use
<code class="methodname"><a class="link" href="class-giobufferedinputstream.html#constructor-giobufferedinputstream" title="Constructor">gio.BufferedInputStream</a></code>(),
or <code class="methodname"><a class="link" href="class-giobufferedinputstream.html#function-gio--buffered-input-stream-new-sized" title="gio.buffered_input_stream_new_sized">gio.buffered_input_stream_new_sized</a></code>()
to specify the buffer's size at construction.
</p><p>
To get the size of a buffer within a buffered input stream, use
<code class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--get-buffer-size" title="gio.BufferedInputStream.get_buffer_size">get_buffer_size</a></code>().
To change the size of a buffered input stream's buffer, use
<code class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--set-buffer-size" title="gio.BufferedInputStream.set_buffer_size">set_buffer_size</a></code>().
Note that the buffer's size cannot be reduced below the size of the data within the buffer.
</p></div><div class="refsect1" title="Constructor"><a name="constructor-giobufferedinputstream"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gio.BufferedInputStream</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>base_stream</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>base_stream</code></em> :</span></p></td><td>a
<a class="link" href="class-gioinputstream.html" title="gio.InputStream"><code class="classname">gio.InputStream</code></a>.
</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new
<a class="link" href="class-gioinputstream.html" title="gio.InputStream"><code class="classname">gio.InputStream</code></a>
for the given base_stream.
</td></tr></tbody></table><p>
Creates a new <a class="link" href="class-gioinputstream.html" title="gio.InputStream"><code class="classname">gio.InputStream</code></a>
from the given base_stream, with a buffer set to the default size (4 kilobytes).
</p></div><div class="refsect1" title="Methods"><a name="id449318"></a><h2>Methods</h2><div class="refsect2" title="gio.BufferedInputStream.fill"><a name="method-giobufferedinputstream--fill"></a><h3>gio.BufferedInputStream.fill</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">fill</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>count</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>count</code></strong> :</span></p></td><td>the number of bytes that will be read from the stream.
</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cancellable</code></strong> :</span></p></td><td>optional
<a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
object, <code class="literal">None</code> to ignore.
</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the number of bytes read into stream's buffer,
up to count, or -1 on error.
</td></tr></tbody></table><p>
The <code class="methodname">fill</code>() method tries to read count bytes
from the stream into the buffer. Will block during this read.
</p><p>
If count is zero, returns zero and does nothing. A value of count
larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error.
</p><p>
On success, the number of bytes read into the buffer is returned. It
is not an error if this is not the same as the requested size, as it can
happen e.g. near the end of a file. Zero is returned on end of file
(or if count is zero), but never otherwise.
</p><p>
If count is -1 then the attempted read size is equal to the number
of bytes that are required to fill the buffer.
</p><p>
If cancellable is not <code class="literal">None</code>, then the operation can
be cancelled by triggering the cancellable object from another thread.
If the operation was cancelled, the error gio.ERROR_CANCELLED will be
returned. If an operation was partially finished when the operation was
cancelled the partial result will be returned, without an error.
</p><p>
On error -1 is returned and error is set accordingly.
</p><p>
For the asynchronous, non-blocking, version of this function, see
<code class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--fill-async" title="gio.BufferedInputStream.fill_async">gio.BufferedInputStream.fill_async</a></code>().
</p></div><div class="refsect2" title="gio.BufferedInputStream.fill_async"><a name="method-giobufferedinputstream--fill-async"></a><h3>gio.BufferedInputStream.fill_async</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">fill_async</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>count</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>callback</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>io_priority</code></strong></span><span class="initializer">=glib.PRIORITY_DEFAULT</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>count</code></strong> :</span></p></td><td>the number of bytes that will be read from the stream.
</td></tr><tr><td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td><td>a GAsyncReadyCallback to call when the request is satisfied.
</td></tr><tr><td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td><td>the
<a class="xref" href="glib-constants.html#glib-priority-constants" title="Glib Priority Constants">Glib Priority Constants</a>
of the request.
</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td>optional
<a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
object, <code class="literal">None</code> to ignore.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td><td>the data to pass to callback function.
</td></tr></tbody></table><p>
The <code class="methodname">fill_async</code>() method reads data into stream's
buffer asynchronously, up to count size. io_priority can be used to
prioritize reads.
</p><p>
For the synchronous version of this function, see
<code class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--fill" title="gio.BufferedInputStream.fill">gio.BufferedInputStream.fill</a></code>().
</p><p>
If cancellable is not <code class="literal">None</code>, then the operation can be cancelled
by triggering the cancellable object from another thread. If the operation was
cancelled, the error gio.ERROR_CANCELLED will be set
</p><p>
If count is -1 then the attempted read size is equal to the number of bytes
that are required to fill the buffer.
</p></div><div class="refsect2" title="gio.BufferedInputStream.fill_finish"><a name="method-giobufferedinputstream--fill-finish"></a><h3>gio.BufferedInputStream.fill_finish</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">fill_finish</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>result</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>result</code></strong> :</span></p></td><td>a <a class="link" href="class-gioasyncresult.html" title="gio.AsyncResult"><code class="classname">gio.AsyncResult</code></a>.
</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the size of the read stream, or -1 on an error.
</td></tr></tbody></table><p>
The <code class="methodname">fill_finish</code>() method finishes an asynchronous
file append operation started with
<code class="methodname"><a class="link" href="class-giobufferedinputstream.html#method-giobufferedinputstream--fill-async" title="gio.BufferedInputStream.fill_async">gio.BufferedInputStream.fill_async</a></code>().
</p></div><div class="refsect2" title="gio.BufferedInputStream.get_available"><a name="method-giobufferedinputstream--get-available"></a><h3>gio.BufferedInputStream.get_available</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_available</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>size of the available stream.
</td></tr></tbody></table><p>
The <code class="methodname">get_available</code>() method gets the size of
the available data within the stream.
</p></div><div class="refsect2" title="gio.BufferedInputStream.get_buffer_size"><a name="method-giobufferedinputstream--get-buffer-size"></a><h3>gio.BufferedInputStream.get_buffer_size</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_buffer_size</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the current buffer size.
</td></tr></tbody></table><p>
The <code class="methodname">get_buffer_size</code>() method gets the size
of the input buffer.
</p></div><div class="refsect2" title="gio.BufferedInputStream.read_byte"><a name="method-giobufferedinputstream--read-byte"></a><h3>gio.BufferedInputStream.read_byte</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">read_byte</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>cancellable</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>cancellable</code></strong> :</span></p></td><td>optional
<a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
object, <code class="literal">None</code> to ignore.
</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the byte read from the stream, or -1 on end of stream or error.
</td></tr></tbody></table><p>
The <code class="methodname">read_byte</code>() method tries to read a single
byte from the stream or the buffer. Will block during this read.
</p><p>
On success, the byte read from the stream is returned. On end of stream -1
is returned but it's not an exceptional error and error is not set.
</p><p>
If cancellable is not <code class="literal">None</code>, then the operation can
be cancelled by triggering the cancellable object from another thread.
If the operation was cancelled, the error gio.ERROR_CANCELLED will be
returned. If an operation was partially finished when the operation was
cancelled the partial result will be returned, without an error.
</p><p>
On error -1 is returned and error is set accordingly.
</p></div><div class="refsect2" title="gio.BufferedInputStream.set_buffer_size"><a name="method-giobufferedinputstream--set-buffer-size"></a><h3>gio.BufferedInputStream.set_buffer_size</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_buffer_size</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>size</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>size</code></strong> :</span></p></td><td>the new buffer size.
</td></tr></tbody></table><p>
The <code class="methodname">set_buffer_size</code>() method sets the size
of the internal buffer of stream to size, or to the size of the contents
of the buffer. The buffer can never be resized smaller than its current contents.
</p></div></div><div class="refsect1" title="Functions"><a name="id353937"></a><h2>Functions</h2><div class="refsect2" title="gio.buffered_input_stream_new_sized"><a name="function-gio--buffered-input-stream-new-sized"></a><h3>gio.buffered_input_stream_new_sized</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">buffered_input_stream_new_sized</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>size</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td><td>the requested buffer size.
</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A new
<a class="link" href="class-gioinputstream.html" title="gio.InputStream"><code class="classname">gio.InputStream</code></a>.
</td></tr></tbody></table><p>
The <code class="methodname">buffered_input_stream_new_sized</code>() function creates
a new <a class="link" href="class-giobufferedinputstream.html" title="gio.BufferedInputStream"><code class="classname">gio.BufferedInputStream</code></a>
from the given base_stream, with a buffer set to size.
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gioasyncresult.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gio-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-giobufferedoutputstream.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gio.AsyncResult </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gio.BufferedOutputStream</td></tr></table></div></body></html>
|