summaryrefslogtreecommitdiffstats
path: root/docs/reference/pygio-datainputstream.xml
blob: 403bb3e5b6d2eaf70ac80e3a710b5086f55a3002 (plain)
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-giodatainputstream">
    <refnamediv>
        <refname>gio.DataInputStream</refname>
        <refpurpose>Data Input Stream</refpurpose>
    </refnamediv>

    <refsect1>
        <title>Synopsis</title>

    <classsynopsis language="python">
        <ooclass><classname>gio.DataInputStream</classname></ooclass>
        <ooclass><classname><link linkend="class-giobufferedinputstream">gio.BufferedInputStream</link></classname></ooclass>

    <constructorsynopsis language="python">
	<methodname><link linkend="constructor-giodatainputstream">gio.DataInputStream</link></methodname>
	<methodparam><parameter role="keyword">base_stream</parameter></methodparam>
    </constructorsynopsis>
    
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--get-byte-order">get_byte_order</link></methodname>
        <methodparam></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--get-newline-type">get_newline_type</link></methodname>
        <methodparam></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-byte">read_byte</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-int16">read_int16</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-int32">read_int32</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-int64">read_int64</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-line">read_line</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-line-async">read_line_async</link></methodname>
        <methodparam><parameter role="keyword">callback</parameter></methodparam>
        <methodparam><parameter role="keyword">io_priority</parameter><initializer>glib.PRIORITY_DEFAULT</initializer></methodparam>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
        <methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-line-finish">read_line_finish</link></methodname>
        <methodparam><parameter role="keyword">result</parameter></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-uint16">read_uint16</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-uint32">read_uint32</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-uint64">read_uint64</link></methodname>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-until">read_until</link></methodname>
        <methodparam><parameter role="keyword">stop_chars</parameter></methodparam>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-until-async">read_until_async</link></methodname>
        <methodparam><parameter role="keyword">stop_chars</parameter></methodparam>
        <methodparam><parameter role="keyword">callback</parameter></methodparam>
        <methodparam><parameter role="keyword">io_priority</parameter><initializer>glib.PRIORITY_DEFAULT</initializer></methodparam>
        <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
        <methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--read-until-finish">read_until_finish</link></methodname>
        <methodparam><parameter role="keyword">result</parameter></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--set-byte-order">set_byte_order</link></methodname>
        <methodparam><parameter role="keyword">order</parameter></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-giodatainputstream--set-newline-type">set_newline_type</link></methodname>
        <methodparam><parameter role="keyword">type</parameter></methodparam>
    </methodsynopsis>

    </classsynopsis>

    </refsect1>

    <refsect1>
        <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gioinputstream">gio.InputStream</link>
    +-- <link linkend="class-giofilterinputstream">gio.FilterInputStream</link>
      +-- <link linkend="class-giobufferedinputstream">gio.BufferedInputStream</link>
        +-- <link linkend="class-giodatainputstream">gio.DataInputStream</link>
</synopsis>

    </refsect1>

    <refsect1 id="properties-giodatainputstream">
        <title>gio.DataInputStream Properties</title>
    
        <blockquote role="properties">
            <informaltable pgwide="1" frame="none">
                <tgroup cols="3">
                    <colspec column="1" colwidth="1in"/>
                    <colspec column="2" colwidth="1in"/>
                    <colspec column="3" colwidth="4in"/>
                    <tbody>
                        <row valign="top">
                            <entry>"byte-order"</entry>
                            <entry>Read - Write</entry>
                            <entry>The byte order. Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.</entry>
                        </row>
                        <row valign="top">
                            <entry>"newline-type"</entry>
                            <entry>Read - Write</entry>
                            <entry>The accepted types of line ending. Default value: gio.DATA_STREAM_NEWLINE_TYPE_LF.</entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>
        </blockquote>
  
    </refsect1>

    <refsect1>
        <title>Description</title>

        <para>
            <link linkend="class-giodatainputstream"><classname>gio.DataInputStream</classname></link>
            implements <link linkend="class-gioinputstream"><classname>gio.InputStream</classname></link>
            and includes functions for reading structured data directly from a binary input stream.
        </para>
    </refsect1>

    <refsect1 id="constructor-giodatainputstream">
        <title>Constructor</title>
  
        <programlisting><constructorsynopsis language="python">
            <methodname>gio.DataInputStream</methodname>
            <methodparam><parameter role="keyword">base_stream</parameter></methodparam>
        </constructorsynopsis></programlisting>
        <variablelist>
            <varlistentry>
                <term><parameter>base_stream</parameter>&nbsp;:</term>
                <listitem><simpara>a
                <link linkend="class-gioinputstream"><classname>gio.InputStream</classname></link>.
                </simpara></listitem>
            </varlistentry>
            <varlistentry>
                <term><emphasis>Returns</emphasis>&nbsp;:</term>
                <listitem><simpara>a new
                <link linkend="class-giodatainputstream"><classname>gio.DataInputStream</classname></link>
                </simpara></listitem>
            </varlistentry>
        </variablelist>
    
        <para>
            Creates a new <link linkend="class-giodatainputstream"><classname>gio.DataInputStream</classname></link>
            from the given base_stream.
        </para>
  
    </refsect1>

    <refsect1>
        <title>Methods</title>

        <refsect2 id="method-giodatainputstream--get-byte-order">
            <title>gio.DataInputStream.get_byte_order</title>

            <programlisting><methodsynopsis language="python">
                <methodname>get_byte_order</methodname>
                <methodparam></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>the stream's current
                    <xref linkend="gio-data-stream-byte-order-constants" endterm="gio-data-stream-byte-order-constants-title"></xref>.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>get_byte_order</methodname>() method gets the byte
                order for the data input stream.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--get-newline-type">
            <title>gio.DataInputStream.get_newline_type</title>

            <programlisting><methodsynopsis language="python">
                <methodname>get_newline_type</methodname>
                <methodparam></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara><xref linkend="gio-data-stream-newline-type-constants" endterm="gio-data-stream-newline-type-constants-title"></xref>
                    for the given stream.                    
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>get_newline_type</methodname>() method gets the current
                newline type for the stream.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-byte">
            <title>gio.DataInputStream.read_byte</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_byte</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>an unsigned 8-bit/1-byte value read from the
                    stream or 0 if an error occurred.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_byte</methodname>() method reads an unsigned 8-bit/1-byte value from stream.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-int16">
            <title>gio.DataInputStream.read_int16</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_int16</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a signed 16-bit/2-byte value read from stream or 0 if an error occurred.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_int16</methodname>() method reads a 16-bit/2-byte value from stream.
            </para>
            <para>
                In order to get the correct byte order for this read operation, see
                <methodname><link linkend="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</link></methodname>()
                and
                <methodname><link linkend="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-int32">
            <title>gio.DataInputStream.read_int32</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_int32</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a signed 32-bit/4-byte value read from the stream
                    or 0 if an error occurred.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_int32</methodname>() method reads a signed 32-bit/4-byte value from stream.
            </para>
            <para>
                In order to get the correct byte order for this read operation, see
                <methodname><link linkend="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</link></methodname>()
                and
                <methodname><link linkend="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-int64">
            <title>gio.DataInputStream.read_int64</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_int64</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a signed 64-bit/8-byte value read from the stream
                    or 0 if an error occurred.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_int64</methodname>() method reads a signed 64-bit/8-byte value from stream.
            </para>
            <para>
                In order to get the correct byte order for this read operation, see
                <methodname><link linkend="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</link></methodname>()
                and
                <methodname><link linkend="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-line">
            <title>gio.DataInputStream.read_line</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_line</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a string with the line that was read in (without the newlines).
                    Set length to a gsize to get the length of the read line. On an error, it will return
                    <literal>None</literal> and error will be set. If there's no content to read, it
                    will still return <literal>None</literal>, but error won't be set.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_line</methodname>() reads a line from the data input stream.
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-line-async">
            <title>gio.DataInputStream.read_line_async</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_line_async</methodname>
                <methodparam><parameter role="keyword">callback</parameter></methodparam>
                <methodparam><parameter role="keyword">io_priority</parameter><initializer>glib.PRIORITY_DEFAULT</initializer></methodparam>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
                <methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><parameter>callback</parameter>&nbsp;:</term>
                    <listitem><simpara>a GAsyncReadyCallback to call when the request is satisfied.
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>io_priority</parameter>&nbsp;:</term>
                    <listitem><simpara>the
                    <xref linkend="glib-priority-constants" endterm="glib-priority-constants-title"></xref>
                    of the request. 
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>cancellable</parameter>&nbsp;:</term>
                    <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>user_data</parameter>&nbsp;:</term>
                    <listitem><simpara>the data to pass to callback function.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_line_async</methodname>() method is the asynchronous version of
                <methodname><link linkend="method-giodatainputstream--read-line">gio.DataInputStream.read_line</link></methodname>().
                It is an error to have two outstanding calls to this function.
            </para>
            <para>
                For the synchronous version of this function, see
                <methodname><link linkend="method-giodatainputstream--read-line">gio.DataInputStream.read_line</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-line-finish">
            <title>gio.DataInputStream.read_line_finish</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_line_finish</methodname>
                <methodparam><parameter role="keyword">result</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">result</parameter>&nbsp;:</term>
                  <listitem><simpara>a <link linkend="class-gioasyncresult"><classname>gio.AsyncResult</classname></link>.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a string with the line that was read in (without the newlines).
                    On an error, it will return <literal>None</literal> and error will be set.
                    If there's no content to read, it will still return <literal>None</literal>,
                    but error won't be set.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_line_finish</methodname>() method finishes an asynchronous
                file append operation started with
                <methodname><link linkend="method-giodatainputstream--read-line-async">gio.DataInputStream.read_line_async</link></methodname>().
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-uint16">
            <title>gio.DataInputStream.read_uint16</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_uint16</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a signed 16-bit/2-byte value read from stream or 0 if an error occurred.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_uint16</methodname>() method reads a 16-bit/2-byte value from stream.
            </para>
            <para>
                In order to get the correct byte order for this read operation, see
                <methodname><link linkend="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</link></methodname>()
                and
                <methodname><link linkend="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-uint32">
            <title>gio.DataInputStream.read_uint32</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_uint32</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a signed 32-bit/4-byte value read from the stream
                    or 0 if an error occurred.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_uint32</methodname>() method reads a signed 32-bit/4-byte value from stream.
            </para>
            <para>
                In order to get the correct byte order for this read operation, see
                <methodname><link linkend="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</link></methodname>()
                and
                <methodname><link linkend="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-uint64">
            <title>gio.DataInputStream.read_uint64</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_uint64</methodname>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a signed 64-bit/8-byte value read from the stream
                    or 0 if an error occurred.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_uint64</methodname>() method reads a signed 64-bit/8-byte value from stream.
            </para>
            <para>
                In order to get the correct byte order for this read operation, see
                <methodname><link linkend="method-giodatainputstream--get-byte_order">gio.DataInputStream.get_byte_order</link></methodname>()
                and
                <methodname><link linkend="method-giodatainputstream--set-byte_order">gio.DataInputStream.set_byte_order</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-until">
            <title>gio.DataInputStream.read_until</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_until</methodname>
                <methodparam><parameter role="keyword">stop_chars</parameter></methodparam>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">stop_chars</parameter>&nbsp;:</term>
                  <listitem><simpara>characters to terminate the read.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                  <term><parameter role="keyword">cancellable</parameter>&nbsp;:</term>
                  <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a string with the data that was read before encountering
                    any of the stop characters. This function will return NULL on an error.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_until</methodname>() reads a string from the data input
                stream, up to the first occurrence of any of the stop characters.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-until-async">
            <title>gio.DataInputStream.read_until_async</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_until_async</methodname>
                <methodparam><parameter role="keyword">stop_chars</parameter></methodparam>
                <methodparam><parameter role="keyword">callback</parameter></methodparam>
                <methodparam><parameter role="keyword">io_priority</parameter><initializer>glib.PRIORITY_DEFAULT</initializer></methodparam>
                <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam>
                <methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">stop_chars</parameter>&nbsp;:</term>
                  <listitem><simpara>characters to terminate the read.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>callback</parameter>&nbsp;:</term>
                    <listitem><simpara>a GAsyncReadyCallback to call when the request is satisfied.
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>io_priority</parameter>&nbsp;:</term>
                    <listitem><simpara>the
                    <xref linkend="glib-priority-constants" endterm="glib-priority-constants-title"></xref>
                    of the request. 
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>cancellable</parameter>&nbsp;:</term>
                    <listitem><simpara>optional
                    <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>
                    object, <literal>None</literal> to ignore.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>user_data</parameter>&nbsp;:</term>
                    <listitem><simpara>the data to pass to callback function.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_until_async</methodname>() method it's the asynchronous version of
                <methodname><link linkend="method-giodatainputstream--read-until">gio.DataInputStream.read_until</link></methodname>().
                It is an error to have two outstanding calls to this function.
            </para>
            <para>
                For the synchronous version of this function, see
                <methodname><link linkend="method-giodatainputstream--read-until">gio.DataInputStream.read_until</link></methodname>().
            </para>
            <para>
                If cancellable is not <literal>None</literal>, 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
            </para>
            <para>
                When the operation is finished, callback will be called. You can then call
                <methodname><link linkend="method-giodatainputstream--read-until-finish">gio.DataInputStream.read_until_finish</link></methodname>()
                to get the result of the operation.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--read-until-finish">
            <title>gio.DataInputStream.read_until_finish</title>

            <programlisting><methodsynopsis language="python">
                <methodname>read_until_finish</methodname>
                <methodparam><parameter role="keyword">result</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">result</parameter>&nbsp;:</term>
                  <listitem><simpara>a <link linkend="class-gioasyncresult"><classname>gio.AsyncResult</classname></link>.
                  </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a string with the data that was read before encountering
                    any of the stop characters. This function will return <literal>None</literal> on an error.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>read_until_finish</methodname>() method finishes an asynchronous
                file append operation started with
                <methodname><link linkend="method-giodatainputstream--read-until-async">gio.DataInputStream.read_until_async</link></methodname>().
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--set-byte-order">
            <title>gio.DataInputStream.set_byte_order</title>

            <programlisting><methodsynopsis language="python">
                <methodname>set_byte_order</methodname>
                <methodparam><parameter role="keyword">order</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">order</parameter>&nbsp;:</term>
                  <listitem><simpara>a
                  <xref linkend="gio-data-stream-byte-order-constants" endterm="gio-data-stream-byte-order-constants-title"></xref> to set.
                  </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>set_byte_order</methodname>() method sets the byte order for
                the given stream. All subsequent reads from the stream will be read in the given order.
            </para>
        </refsect2>

        <refsect2 id="method-giodatainputstream--set-newline-type">
            <title>gio.DataInputStream.set_newline_type</title>

            <programlisting><methodsynopsis language="python">
                <methodname>set_newline_type</methodname>
                <methodparam><parameter role="keyword">type</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
                  <listitem><simpara>a
                  <xref linkend="gio-data-stream-newline-type-constants" endterm="gio-data-stream-newline-type-constants-title"></xref> to set.
                  </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>set_newline_type</methodname>() method sets the newline type for the stream.
            </para>
            <note>
                Note that using gio.DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a
                read chunk ends in "CR" we must read an additional byte to know if this is
                "CR" or "CR LF", and this might block if there is no more data availible.
            </note>
        </refsect2>
    </refsect1>
</refentry>