Imported Upstream version 2.28.4
[platform/upstream/pygobject2.git] / docs / html / class-giodatainputstream.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gio.DataInputStream</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-giocancellable.html" title="gio.Cancellable"><link rel="next" href="class-giodataoutputstream.html" title="gio.DataOutputStream"></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.DataInputStream</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-giocancellable.html">Prev</a> </td><th width="60%" align="center">PyGio Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-giodataoutputstream.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gio.DataInputStream"><a name="class-giodatainputstream"></a><div class="titlepage"></div><div class="refnamediv"><h2>gio.DataInputStream</h2><p>gio.DataInputStream — Data Input Stream</p></div><div class="refsect1" title="Synopsis"><a name="id593085"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gio.DataInputStream</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-giobufferedinputstream.html" title="gio.BufferedInputStream">gio.BufferedInputStream</a></span></span>):
2 <code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-giodatainputstream.html#constructor-giodatainputstream" title="Constructor">gio.DataInputStream</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-giodatainputstream.html#method-giodatainputstream--get-byte-order" title="gio.DataInputStream.get_byte_order">get_byte_order</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--get-newline-type" title="gio.DataInputStream.get_newline_type">get_newline_type</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-byte" title="gio.DataInputStream.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-giodatainputstream.html#method-giodatainputstream--read-int16" title="gio.DataInputStream.read_int16">read_int16</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-giodatainputstream.html#method-giodatainputstream--read-int32" title="gio.DataInputStream.read_int32">read_int32</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-giodatainputstream.html#method-giodatainputstream--read-int64" title="gio.DataInputStream.read_int64">read_int64</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-giodatainputstream.html#method-giodatainputstream--read-line" title="gio.DataInputStream.read_line">read_line</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-giodatainputstream.html#method-giodatainputstream--read-line-async" title="gio.DataInputStream.read_line_async">read_line_async</a></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-giodatainputstream.html#method-giodatainputstream--read-line-finish" title="gio.DataInputStream.read_line_finish">read_line_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-giodatainputstream.html#method-giodatainputstream--read-uint16" title="gio.DataInputStream.read_uint16">read_uint16</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-giodatainputstream.html#method-giodatainputstream--read-uint32" title="gio.DataInputStream.read_uint32">read_uint32</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-giodatainputstream.html#method-giodatainputstream--read-uint64" title="gio.DataInputStream.read_uint64">read_uint64</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-giodatainputstream.html#method-giodatainputstream--read-until" title="gio.DataInputStream.read_until">read_until</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stop_chars</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-giodatainputstream.html#method-giodatainputstream--read-until-async" title="gio.DataInputStream.read_until_async">read_until_async</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stop_chars</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-giodatainputstream.html#method-giodatainputstream--read-until-finish" title="gio.DataInputStream.read_until_finish">read_until_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-giodatainputstream.html#method-giodatainputstream--set-byte-order" title="gio.DataInputStream.set_byte_order">set_byte_order</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>order</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--set-newline-type" title="gio.DataInputStream.set_newline_type">set_newline_type</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id599112"></a><h2>Ancestry</h2><pre class="synopsis">+-- <a class="link" href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
3   +-- <a class="link" href="class-gioinputstream.html" title="gio.InputStream">gio.InputStream</a>
4     +-- <a class="link" href="class-giofilterinputstream.html" title="gio.FilterInputStream">gio.FilterInputStream</a>
5       +-- <a class="link" href="class-giobufferedinputstream.html" title="gio.BufferedInputStream">gio.BufferedInputStream</a>
6         +-- <a class="link" href="class-giodatainputstream.html" title="gio.DataInputStream">gio.DataInputStream</a>
7 </pre></div><div class="refsect1" title="gio.DataInputStream Properties"><a name="properties-giodatainputstream"></a><h2>gio.DataInputStream 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">"byte-order"</td><td valign="top">Read - Write</td><td valign="top">The byte order. Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.</td></tr><tr valign="top"><td valign="top">"newline-type"</td><td valign="top">Read - Write</td><td valign="top">The accepted types of line ending. Default value: gio.DATA_STREAM_NEWLINE_TYPE_LF.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="Description"><a name="id635454"></a><h2>Description</h2><p>
8             <a class="link" href="class-giodatainputstream.html" title="gio.DataInputStream"><code class="classname">gio.DataInputStream</code></a>
9             implements <a class="link" href="class-gioinputstream.html" title="gio.InputStream"><code class="classname">gio.InputStream</code></a>
10             and includes functions for reading structured data directly from a binary input stream.
11         </p></div><div class="refsect1" title="Constructor"><a name="constructor-giodatainputstream"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gio.DataInputStream</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
12                 <a class="link" href="class-gioinputstream.html" title="gio.InputStream"><code class="classname">gio.InputStream</code></a>.
13                 </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new
14                 <a class="link" href="class-giodatainputstream.html" title="gio.DataInputStream"><code class="classname">gio.DataInputStream</code></a>
15                 </td></tr></tbody></table><p>
16             Creates a new <a class="link" href="class-giodatainputstream.html" title="gio.DataInputStream"><code class="classname">gio.DataInputStream</code></a>
17             from the given base_stream.
18         </p></div><div class="refsect1" title="Methods"><a name="id659412"></a><h2>Methods</h2><div class="refsect2" title="gio.DataInputStream.get_byte_order"><a name="method-giodatainputstream--get-byte-order"></a><h3>gio.DataInputStream.get_byte_order</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_byte_order</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 stream's current
19                     <a class="xref" href="gio-constants.html#gio-data-stream-byte-order-constants" title="Gio Data Stream Byte Order Constants">Gio Data Stream Byte Order Constants</a>.
20                     </td></tr></tbody></table><p>
21                 The <code class="methodname">get_byte_order</code>() method gets the byte
22                 order for the data input stream.
23             </p></div><div class="refsect2" title="gio.DataInputStream.get_newline_type"><a name="method-giodatainputstream--get-newline-type"></a><h3>gio.DataInputStream.get_newline_type</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_newline_type</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><a class="xref" href="gio-constants.html#gio-data-stream-newline-type-constants" title="Gio Data Stream Newline Type Constants">Gio Data Stream Newline Type Constants</a>
24                     for the given stream.                    
25                     </td></tr></tbody></table><p>
26                 The <code class="methodname">get_newline_type</code>() method gets the current
27                 newline type for the stream.
28             </p></div><div class="refsect2" title="gio.DataInputStream.read_byte"><a name="method-giodatainputstream--read-byte"></a><h3>gio.DataInputStream.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
29                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
30                     object, <code class="literal">None</code> to ignore.
31                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>an unsigned 8-bit/1-byte value read from the
32                     stream or 0 if an error occurred.
33                     </td></tr></tbody></table><p>
34                 The <code class="methodname">read_byte</code>() method reads an unsigned 8-bit/1-byte value from stream.
35             </p></div><div class="refsect2" title="gio.DataInputStream.read_int16"><a name="method-giodatainputstream--read-int16"></a><h3>gio.DataInputStream.read_int16</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_int16</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
36                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
37                     object, <code class="literal">None</code> to ignore.
38                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a signed 16-bit/2-byte value read from stream or 0 if an error occurred.
39                     </td></tr></tbody></table><p>
40                 The <code class="methodname">read_int16</code>() method reads a 16-bit/2-byte value from stream.
41             </p><p>
42                 In order to get the correct byte order for this read operation, see
43                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</PYGTKDOCLINK></code>()
44                 and
45                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</PYGTKDOCLINK></code>().
46             </p><p>
47                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled by
48                 triggering the cancellable object from another thread. If the operation was cancelled,
49                 the error gio.ERROR_CANCELLED will be returned.
50             </p></div><div class="refsect2" title="gio.DataInputStream.read_int32"><a name="method-giodatainputstream--read-int32"></a><h3>gio.DataInputStream.read_int32</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_int32</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
51                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
52                     object, <code class="literal">None</code> to ignore.
53                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a signed 32-bit/4-byte value read from the stream
54                     or 0 if an error occurred.
55                     </td></tr></tbody></table><p>
56                 The <code class="methodname">read_int32</code>() method reads a signed 32-bit/4-byte value from stream.
57             </p><p>
58                 In order to get the correct byte order for this read operation, see
59                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</PYGTKDOCLINK></code>()
60                 and
61                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</PYGTKDOCLINK></code>().
62             </p><p>
63                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled by
64                 triggering the cancellable object from another thread. If the operation was cancelled,
65                 the error gio.ERROR_CANCELLED will be returned.
66             </p></div><div class="refsect2" title="gio.DataInputStream.read_int64"><a name="method-giodatainputstream--read-int64"></a><h3>gio.DataInputStream.read_int64</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_int64</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
67                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
68                     object, <code class="literal">None</code> to ignore.
69                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a signed 64-bit/8-byte value read from the stream
70                     or 0 if an error occurred.
71                     </td></tr></tbody></table><p>
72                 The <code class="methodname">read_int64</code>() method reads a signed 64-bit/8-byte value from stream.
73             </p><p>
74                 In order to get the correct byte order for this read operation, see
75                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</PYGTKDOCLINK></code>()
76                 and
77                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</PYGTKDOCLINK></code>().
78             </p><p>
79                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled by
80                 triggering the cancellable object from another thread. If the operation was cancelled,
81                 the error gio.ERROR_CANCELLED will be returned.
82             </p></div><div class="refsect2" title="gio.DataInputStream.read_line"><a name="method-giodatainputstream--read-line"></a><h3>gio.DataInputStream.read_line</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_line</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
83                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
84                     object, <code class="literal">None</code> to ignore.
85                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string with the line that was read in (without the newlines).
86                     Set length to a gsize to get the length of the read line. On an error, it will return
87                     <code class="literal">None</code> and error will be set. If there's no content to read, it
88                     will still return <code class="literal">None</code>, but error won't be set.
89                     </td></tr></tbody></table><p>
90                 The <code class="methodname">read_line</code>() reads a line from the data input stream.
91             </p><p>
92                 If cancellable is not <code class="literal">None</code>, then the operation can
93                 be cancelled by triggering the cancellable object from another thread.
94                 If the operation was cancelled, the error gio.ERROR_CANCELLED will be
95                 returned. If an operation was partially finished when the operation was
96                 cancelled the partial result will be returned, without an error.
97             </p></div><div class="refsect2" title="gio.DataInputStream.read_line_async"><a name="method-giodatainputstream--read-line-async"></a><h3>gio.DataInputStream.read_line_async</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_line_async</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"><em class="parameter"><code>callback</code></em> :</span></p></td><td>a GAsyncReadyCallback to call when the request is satisfied.
98                     </td></tr><tr><td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td><td>the
99                     <a class="xref" href="glib-constants.html#glib-priority-constants" title="Glib Priority Constants">Glib Priority Constants</a>
100                     of the request. 
101                     </td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td>optional
102                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
103                     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.
104                     </td></tr></tbody></table><p>
105                 The <code class="methodname">read_line_async</code>() method is the asynchronous version of
106                 <code class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-line" title="gio.DataInputStream.read_line">gio.DataInputStream.read_line</a></code>().
107                 It is an error to have two outstanding calls to this function.
108             </p><p>
109                 For the synchronous version of this function, see
110                 <code class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-line" title="gio.DataInputStream.read_line">gio.DataInputStream.read_line</a></code>().
111             </p><p>
112                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled
113                 by triggering the cancellable object from another thread. If the operation was
114                 cancelled, the error gio.ERROR_CANCELLED will be set
115             </p></div><div class="refsect2" title="gio.DataInputStream.read_line_finish"><a name="method-giodatainputstream--read-line-finish"></a><h3>gio.DataInputStream.read_line_finish</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_line_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>.
116                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string with the line that was read in (without the newlines).
117                     On an error, it will return <code class="literal">None</code> and error will be set.
118                     If there's no content to read, it will still return <code class="literal">None</code>,
119                     but error won't be set.
120                     </td></tr></tbody></table><p>
121                 The <code class="methodname">read_line_finish</code>() method finishes an asynchronous
122                 file append operation started with
123                 <code class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-line-async" title="gio.DataInputStream.read_line_async">gio.DataInputStream.read_line_async</a></code>().
124             </p></div><div class="refsect2" title="gio.DataInputStream.read_uint16"><a name="method-giodatainputstream--read-uint16"></a><h3>gio.DataInputStream.read_uint16</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_uint16</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
125                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
126                     object, <code class="literal">None</code> to ignore.
127                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a signed 16-bit/2-byte value read from stream or 0 if an error occurred.
128                     </td></tr></tbody></table><p>
129                 The <code class="methodname">read_uint16</code>() method reads a 16-bit/2-byte value from stream.
130             </p><p>
131                 In order to get the correct byte order for this read operation, see
132                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</PYGTKDOCLINK></code>()
133                 and
134                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</PYGTKDOCLINK></code>().
135             </p><p>
136                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled by
137                 triggering the cancellable object from another thread. If the operation was cancelled,
138                 the error gio.ERROR_CANCELLED will be returned.
139             </p></div><div class="refsect2" title="gio.DataInputStream.read_uint32"><a name="method-giodatainputstream--read-uint32"></a><h3>gio.DataInputStream.read_uint32</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_uint32</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
140                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
141                     object, <code class="literal">None</code> to ignore.
142                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a signed 32-bit/4-byte value read from the stream
143                     or 0 if an error occurred.
144                     </td></tr></tbody></table><p>
145                 The <code class="methodname">read_uint32</code>() method reads a signed 32-bit/4-byte value from stream.
146             </p><p>
147                 In order to get the correct byte order for this read operation, see
148                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</PYGTKDOCLINK></code>()
149                 and
150                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</PYGTKDOCLINK></code>().
151             </p><p>
152                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled by
153                 triggering the cancellable object from another thread. If the operation was cancelled,
154                 the error gio.ERROR_CANCELLED will be returned.
155             </p></div><div class="refsect2" title="gio.DataInputStream.read_uint64"><a name="method-giodatainputstream--read-uint64"></a><h3>gio.DataInputStream.read_uint64</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_uint64</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
156                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
157                     object, <code class="literal">None</code> to ignore.
158                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a signed 64-bit/8-byte value read from the stream
159                     or 0 if an error occurred.
160                     </td></tr></tbody></table><p>
161                 The <code class="methodname">read_uint64</code>() method reads a signed 64-bit/8-byte value from stream.
162             </p><p>
163                 In order to get the correct byte order for this read operation, see
164                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</PYGTKDOCLINK></code>()
165                 and
166                 <code class="methodname"><PYGTKDOCLINK HREF="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</PYGTKDOCLINK></code>().
167             </p><p>
168                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled by
169                 triggering the cancellable object from another thread. If the operation was cancelled,
170                 the error gio.ERROR_CANCELLED will be returned.
171             </p></div><div class="refsect2" title="gio.DataInputStream.read_until"><a name="method-giodatainputstream--read-until"></a><h3>gio.DataInputStream.read_until</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_until</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stop_chars</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>stop_chars</code></strong> :</span></p></td><td>characters to terminate the read.
172                   </td></tr><tr><td><p><span class="term"><strong class="parameter"><code>cancellable</code></strong> :</span></p></td><td>optional
173                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
174                     object, <code class="literal">None</code> to ignore.
175                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string with the data that was read before encountering
176                     any of the stop characters. This function will return NULL on an error.
177                     </td></tr></tbody></table><p>
178                 The <code class="methodname">read_until</code>() reads a string from the data input
179                 stream, up to the first occurrence of any of the stop characters.
180             </p></div><div class="refsect2" title="gio.DataInputStream.read_until_async"><a name="method-giodatainputstream--read-until-async"></a><h3>gio.DataInputStream.read_until_async</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_until_async</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>stop_chars</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>stop_chars</code></strong> :</span></p></td><td>characters to terminate the read.
181                   </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.
182                     </td></tr><tr><td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td><td>the
183                     <a class="xref" href="glib-constants.html#glib-priority-constants" title="Glib Priority Constants">Glib Priority Constants</a>
184                     of the request. 
185                     </td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td>optional
186                     <a class="link" href="class-giocancellable.html" title="gio.Cancellable"><code class="classname">gio.Cancellable</code></a>
187                     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.
188                     </td></tr></tbody></table><p>
189                 The <code class="methodname">read_until_async</code>() method it's the asynchronous version of
190                 <code class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-until" title="gio.DataInputStream.read_until">gio.DataInputStream.read_until</a></code>().
191                 It is an error to have two outstanding calls to this function.
192             </p><p>
193                 For the synchronous version of this function, see
194                 <code class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-until" title="gio.DataInputStream.read_until">gio.DataInputStream.read_until</a></code>().
195             </p><p>
196                 If cancellable is not <code class="literal">None</code>, then the operation can be cancelled
197                 by triggering the cancellable object from another thread. If the operation was
198                 cancelled, the error gio.ERROR_CANCELLED will be set
199             </p><p>
200                 When the operation is finished, callback will be called. You can then call
201                 <code class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-until-finish" title="gio.DataInputStream.read_until_finish">gio.DataInputStream.read_until_finish</a></code>()
202                 to get the result of the operation.
203             </p></div><div class="refsect2" title="gio.DataInputStream.read_until_finish"><a name="method-giodatainputstream--read-until-finish"></a><h3>gio.DataInputStream.read_until_finish</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">read_until_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>.
204                   </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a string with the data that was read before encountering
205                     any of the stop characters. This function will return <code class="literal">None</code> on an error.
206                     </td></tr></tbody></table><p>
207                 The <code class="methodname">read_until_finish</code>() method finishes an asynchronous
208                 file append operation started with
209                 <code class="methodname"><a class="link" href="class-giodatainputstream.html#method-giodatainputstream--read-until-async" title="gio.DataInputStream.read_until_async">gio.DataInputStream.read_until_async</a></code>().
210             </p></div><div class="refsect2" title="gio.DataInputStream.set_byte_order"><a name="method-giodatainputstream--set-byte-order"></a><h3>gio.DataInputStream.set_byte_order</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_byte_order</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>order</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>order</code></strong> :</span></p></td><td>a
211                   <a class="xref" href="gio-constants.html#gio-data-stream-byte-order-constants" title="Gio Data Stream Byte Order Constants">Gio Data Stream Byte Order Constants</a> to set.
212                   </td></tr></tbody></table><p>
213                 The <code class="methodname">set_byte_order</code>() method sets the byte order for
214                 the given stream. All subsequent reads from the stream will be read in the given order.
215             </p></div><div class="refsect2" title="gio.DataInputStream.set_newline_type"><a name="method-giodatainputstream--set-newline-type"></a><h3>gio.DataInputStream.set_newline_type</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_newline_type</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</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>type</code></strong> :</span></p></td><td>a
216                   <a class="xref" href="gio-constants.html#gio-data-stream-newline-type-constants" title="Gio Data Stream Newline Type Constants">Gio Data Stream Newline Type Constants</a> to set.
217                   </td></tr></tbody></table><p>
218                 The <code class="methodname">set_newline_type</code>() method sets the newline type for the stream.
219             </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
220                 Note that using gio.DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a
221                 read chunk ends in "CR" we must read an additional byte to know if this is
222                 "CR" or "CR LF", and this might block if there is no more data availible.
223             </div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-giocancellable.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-giodataoutputstream.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gio.Cancellable </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gio.DataOutputStream</td></tr></table></div></body></html>