<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GBufferedInputStream">
<refmeta>
<refentrytitle role="top_of_page" id="GBufferedInputStream.top_of_page">GBufferedInputStream</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GBufferedInputStream</refname>
<refpurpose>Buffered Input Stream</refpurpose>
</refnamediv>

<refsynopsisdiv id="GBufferedInputStream.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gio/gio.h&gt;

                    <link linkend="GBufferedInputStream-struct">GBufferedInputStream</link>;
<link linkend="GInputStream">GInputStream</link>*       <link linkend="g-buffered-input-stream-new">g_buffered_input_stream_new</link>         (<link linkend="GInputStream">GInputStream</link> *base_stream);
<link linkend="GInputStream">GInputStream</link>*       <link linkend="g-buffered-input-stream-new-sized">g_buffered_input_stream_new_sized</link>   (<link linkend="GInputStream">GInputStream</link> *base_stream,
                                                         <link linkend="gsize">gsize</link> size);
<link linkend="gsize">gsize</link>               <link linkend="g-buffered-input-stream-get-buffer-size">g_buffered_input_stream_get_buffer_size</link>
                                                        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream);
<link linkend="void">void</link>                <link linkend="g-buffered-input-stream-set-buffer-size">g_buffered_input_stream_set_buffer_size</link>
                                                        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gsize">gsize</link> size);
<link linkend="gsize">gsize</link>               <link linkend="g-buffered-input-stream-get-available">g_buffered_input_stream_get_available</link>
                                                        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream);
const <link linkend="void">void</link>*         <link linkend="g-buffered-input-stream-peek-buffer">g_buffered_input_stream_peek_buffer</link> (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gsize">gsize</link> *count);
<link linkend="gsize">gsize</link>               <link linkend="g-buffered-input-stream-peek">g_buffered_input_stream_peek</link>        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="void">void</link> *buffer,
                                                         <link linkend="gsize">gsize</link> offset,
                                                         <link linkend="gsize">gsize</link> count);
<link linkend="gssize">gssize</link>              <link linkend="g-buffered-input-stream-fill">g_buffered_input_stream_fill</link>        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gssize">gssize</link> count,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-buffered-input-stream-fill-async">g_buffered_input_stream_fill_async</link>  (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gssize">gssize</link> count,
                                                         <link linkend="int">int</link> io_priority,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gssize">gssize</link>              <link linkend="g-buffered-input-stream-fill-finish">g_buffered_input_stream_fill_finish</link> (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="int">int</link>                 <link linkend="g-buffered-input-stream-read-byte">g_buffered_input_stream_read_byte</link>   (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GBufferedInputStream.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInputStream">GInputStream</link>
         +----<link linkend="GFilterInputStream">GFilterInputStream</link>
               +----GBufferedInputStream
                     +----<link linkend="GDataInputStream">GDataInputStream</link>
</synopsis>
</refsect1>





<refsect1 id="GBufferedInputStream.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GBufferedInputStream--buffer-size">buffer-size</link>&quot;              <link linkend="guint">guint</link>                 : Read / Write / Construct
</synopsis>
</refsect1>



<refsect1 id="GBufferedInputStream.description" role="desc">
<title role="desc.title">Description</title>
<para>
Buffered input stream implements <link linkend="GFilterInputStream"><type>GFilterInputStream</type></link> and provides 
for buffered reads. 
</para>
<para>
By default, <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>'s buffer size is set at 4 kilobytes.
</para>
<para>
To create a buffered input stream, use <link linkend="g-buffered-input-stream-new"><function>g_buffered_input_stream_new()</function></link>, 
or <link linkend="g-buffered-input-stream-new-sized"><function>g_buffered_input_stream_new_sized()</function></link> to specify the buffer's size at 
construction.
</para>
<para>
To get the size of a buffer within a buffered input stream, use 
<link linkend="g-buffered-input-stream-get-buffer-size"><function>g_buffered_input_stream_get_buffer_size()</function></link>. To change the size of a 
buffered input stream's buffer, use
<link linkend="g-buffered-input-stream-set-buffer-size"><function>g_buffered_input_stream_set_buffer_size()</function></link>. Note that the buffer's size 
cannot be reduced below the size of the data within the buffer.</para>
<para>
</para>
</refsect1>

<refsect1 id="GBufferedInputStream.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GBufferedInputStream-struct" role="struct">
<title>GBufferedInputStream</title>
<indexterm zone="GBufferedInputStream-struct"><primary sortas="BufferedInputStream">GBufferedInputStream</primary></indexterm><programlisting>typedef struct _GBufferedInputStream GBufferedInputStream;</programlisting>
<para>
Implements <link linkend="GFilterInputStream"><type>GFilterInputStream</type></link> with a sized input buffer.</para>
<para>
</para></refsect2>
<refsect2 id="g-buffered-input-stream-new" role="function">
<title>g_buffered_input_stream_new ()</title>
<indexterm zone="g-buffered-input-stream-new"><primary sortas="buffered_input_stream_new">g_buffered_input_stream_new</primary></indexterm><programlisting><link linkend="GInputStream">GInputStream</link>*       g_buffered_input_stream_new         (<link linkend="GInputStream">GInputStream</link> *base_stream);</programlisting>
<para>
Creates a new <link linkend="GInputStream"><type>GInputStream</type></link> from the given <parameter>base_stream</parameter>, with 
a buffer set to the default size (4 kilobytes).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>base_stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link> for the given <parameter>base_stream</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-new-sized" role="function">
<title>g_buffered_input_stream_new_sized ()</title>
<indexterm zone="g-buffered-input-stream-new-sized"><primary sortas="buffered_input_stream_new_sized">g_buffered_input_stream_new_sized</primary></indexterm><programlisting><link linkend="GInputStream">GInputStream</link>*       g_buffered_input_stream_new_sized   (<link linkend="GInputStream">GInputStream</link> *base_stream,
                                                         <link linkend="gsize">gsize</link> size);</programlisting>
<para>
Creates a new <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link> from the given <parameter>base_stream</parameter>, 
with a buffer set to <parameter>size</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>base_stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="gsize"><type>gsize</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-get-buffer-size" role="function">
<title>g_buffered_input_stream_get_buffer_size ()</title>
<indexterm zone="g-buffered-input-stream-get-buffer-size"><primary sortas="buffered_input_stream_get_buffer_size">g_buffered_input_stream_get_buffer_size</primary></indexterm><programlisting><link linkend="gsize">gsize</link>               g_buffered_input_stream_get_buffer_size
                                                        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream);</programlisting>
<para>
Gets the size of the input buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the current buffer size.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-set-buffer-size" role="function">
<title>g_buffered_input_stream_set_buffer_size ()</title>
<indexterm zone="g-buffered-input-stream-set-buffer-size"><primary sortas="buffered_input_stream_set_buffer_size">g_buffered_input_stream_set_buffer_size</primary></indexterm><programlisting><link linkend="void">void</link>                g_buffered_input_stream_set_buffer_size
                                                        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gsize">gsize</link> size);</programlisting>
<para>
Sets the size of the internal buffer of <parameter>stream</parameter> to <parameter>size</parameter>, or to the 
size of the contents of the buffer. The buffer can never be resized 
smaller than its current contents.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="gsize"><type>gsize</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-get-available" role="function">
<title>g_buffered_input_stream_get_available ()</title>
<indexterm zone="g-buffered-input-stream-get-available"><primary sortas="buffered_input_stream_get_available">g_buffered_input_stream_get_available</primary></indexterm><programlisting><link linkend="gsize">gsize</link>               g_buffered_input_stream_get_available
                                                        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream);</programlisting>
<para>
Gets the size of the available data within the stream.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> size of the available stream. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-peek-buffer" role="function">
<title>g_buffered_input_stream_peek_buffer ()</title>
<indexterm zone="g-buffered-input-stream-peek-buffer"><primary sortas="buffered_input_stream_peek_buffer">g_buffered_input_stream_peek_buffer</primary></indexterm><programlisting>const <link linkend="void">void</link>*         g_buffered_input_stream_peek_buffer (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gsize">gsize</link> *count);</programlisting>
<para>
Returns the buffer with the currently available bytes. The returned
buffer must not be modified and will become invalid when reading from
the stream or filling the buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>count</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="gsize"><type>gsize</type></link> to get the number of bytes available in the buffer.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> read-only buffer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-peek" role="function">
<title>g_buffered_input_stream_peek ()</title>
<indexterm zone="g-buffered-input-stream-peek"><primary sortas="buffered_input_stream_peek">g_buffered_input_stream_peek</primary></indexterm><programlisting><link linkend="gsize">gsize</link>               g_buffered_input_stream_peek        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="void">void</link> *buffer,
                                                         <link linkend="gsize">gsize</link> offset,
                                                         <link linkend="gsize">gsize</link> count);</programlisting>
<para>
Peeks in the buffer, copying data of size <parameter>count</parameter> into <parameter>buffer</parameter>, 
offset <parameter>offset</parameter> bytes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a pointer to an allocated chunk of memory.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>offset</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="gsize"><type>gsize</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>count</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="gsize"><type>gsize</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="gsize"><type>gsize</type></link> of the number of bytes peeked, or <link linkend="1--CAPS"><literal>-1</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-fill" role="function">
<title>g_buffered_input_stream_fill ()</title>
<indexterm zone="g-buffered-input-stream-fill"><primary sortas="buffered_input_stream_fill">g_buffered_input_stream_fill</primary></indexterm><programlisting><link linkend="gssize">gssize</link>              g_buffered_input_stream_fill        (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gssize">gssize</link> count,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Tries to read <parameter>count</parameter> bytes from the stream into the buffer. 
Will block during this read.
</para>
<para>
If <parameter>count</parameter> is zero, returns zero and does nothing. A value of <parameter>count</parameter>
larger than <link linkend="G-MAXSSIZE--CAPS"><literal>G_MAXSSIZE</literal></link> will cause a <link linkend="G-IO-ERROR-INVALID-ARGUMENT--CAPS"><literal>G_IO_ERROR_INVALID_ARGUMENT</literal></link> error.
</para>
<para>
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 <parameter>count</parameter> is zero),  but never otherwise.
</para>
<para>
If <parameter>count</parameter> is -1 then the attempted read size is equal to the number of
bytes that are required to fill the buffer.
</para>
<para>
If <parameter>cancellable</parameter> is not <link linkend="NULL--CAPS"><literal>NULL</literal></link>, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error <link linkend="G-IO-ERROR-CANCELLED--CAPS"><literal>G_IO_ERROR_CANCELLED</literal></link> will be returned. If an
operation was partially finished when the operation was cancelled the
partial result will be returned, without an error.
</para>
<para>
On error -1 is returned and <parameter>error</parameter> is set accordingly.
</para>
<para>
For the asynchronous, non-blocking, version of this function, see 
<link linkend="g-buffered-input-stream-fill-async"><function>g_buffered_input_stream_fill_async()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>count</parameter>&#160;:</term>
<listitem><simpara> the number of bytes that will be read from the stream.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes read into <parameter>stream</parameter>'s buffer, up to <parameter>count</parameter>, 
    or -1 on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-fill-async" role="function">
<title>g_buffered_input_stream_fill_async ()</title>
<indexterm zone="g-buffered-input-stream-fill-async"><primary sortas="buffered_input_stream_fill_async">g_buffered_input_stream_fill_async</primary></indexterm><programlisting><link linkend="void">void</link>                g_buffered_input_stream_fill_async  (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="gssize">gssize</link> count,
                                                         <link linkend="int">int</link> io_priority,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Reads data into <parameter>stream</parameter>'s buffer asynchronously, up to <parameter>count</parameter> size.
<parameter>io_priority</parameter> can be used to prioritize reads. For the synchronous
version of this function, see <link linkend="g-buffered-input-stream-fill"><function>g_buffered_input_stream_fill()</function></link>.
</para>
<para>
If <parameter>count</parameter> is -1 then the attempted read size is equal to the number
of bytes that are required to fill the buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>count</parameter>&#160;:</term>
<listitem><simpara> the number of bytes that will be read from the stream.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>io_priority</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="io-priority">I/O priority</link> 
    of the request.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-fill-finish" role="function">
<title>g_buffered_input_stream_fill_finish ()</title>
<indexterm zone="g-buffered-input-stream-fill-finish"><primary sortas="buffered_input_stream_fill_finish">g_buffered_input_stream_fill_finish</primary></indexterm><programlisting><link linkend="gssize">gssize</link>              g_buffered_input_stream_fill_finish (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes an asynchronous read.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="gssize"><type>gssize</type></link> of the read stream, or <link linkend="1--CAPS"><literal>-1</literal></link> on an error. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-buffered-input-stream-read-byte" role="function">
<title>g_buffered_input_stream_read_byte ()</title>
<indexterm zone="g-buffered-input-stream-read-byte"><primary sortas="buffered_input_stream_read_byte">g_buffered_input_stream_read_byte</primary></indexterm><programlisting><link linkend="int">int</link>                 g_buffered_input_stream_read_byte   (<link linkend="GBufferedInputStream">GBufferedInputStream</link> *stream,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Tries to read a single byte from the stream or the buffer. Will block
during this read.
</para>
<para>
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 <parameter>error</parameter> is not set.
</para>
<para>
If <parameter>cancellable</parameter> is not <link linkend="NULL--CAPS"><literal>NULL</literal></link>, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error <link linkend="G-IO-ERROR-CANCELLED--CAPS"><literal>G_IO_ERROR_CANCELLED</literal></link> will be returned. If an
operation was partially finished when the operation was cancelled the
partial result will be returned, without an error.
</para>
<para>
On error -1 is returned and <parameter>error</parameter> is set accordingly.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GBufferedInputStream"><type>GBufferedInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the byte read from the <parameter>stream</parameter>, or -1 on end of stream or error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GBufferedInputStream.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GBufferedInputStream--buffer-size" role="property"><title>The <literal>&quot;buffer-size&quot;</literal> property</title>
<indexterm zone="GBufferedInputStream--buffer-size"><primary sortas="BufferedInputStream:buffer-size">GBufferedInputStream:buffer-size</primary></indexterm><programlisting>  &quot;buffer-size&quot;              <link linkend="guint">guint</link>                 : Read / Write / Construct</programlisting>
<para>The size of the backend buffer.</para><para>Allowed values: &gt;= 1</para>
<para>Default value: 4096</para>
</refsect2>
</refsect1>



<refsect1 id="GBufferedInputStream.see-also">
<title>See Also</title>
#GFilterInputStream, <link linkend="GInputStream"><type>GInputStream</type></link>
</refsect1>

</refentry>
