3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>buffered_read_stream</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../reference.html" title="Reference">
9 <link rel="prev" href="buffer_size/overload5.html" title="buffer_size (5 of 5 overloads)">
10 <link rel="next" href="buffered_read_stream/async_fill.html" title="buffered_read_stream::async_fill">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="buffer_size/overload5.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="buffered_read_stream/async_fill.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="boost_asio.reference.buffered_read_stream"></a><a class="link" href="buffered_read_stream.html" title="buffered_read_stream">buffered_read_stream</a>
28 </h3></div></div></div>
30 Adds buffering to the read-related operations of a stream.
32 <pre class="programlisting"><span class="keyword">template</span><span class="special"><</span>
33 <span class="keyword">typename</span> <span class="identifier">Stream</span><span class="special">></span>
34 <span class="keyword">class</span> <span class="identifier">buffered_read_stream</span> <span class="special">:</span>
35 <span class="identifier">noncopyable</span>
38 <a name="boost_asio.reference.buffered_read_stream.h0"></a>
39 <span class="phrase"><a name="boost_asio.reference.buffered_read_stream.types"></a></span><a class="link" href="buffered_read_stream.html#boost_asio.reference.buffered_read_stream.types">Types</a>
41 <div class="informaltable"><table class="table">
62 <a class="link" href="buffered_read_stream/lowest_layer_type.html" title="buffered_read_stream::lowest_layer_type"><span class="bold"><strong>lowest_layer_type</strong></span></a>
67 The type of the lowest layer.
74 <a class="link" href="buffered_read_stream/next_layer_type.html" title="buffered_read_stream::next_layer_type"><span class="bold"><strong>next_layer_type</strong></span></a>
79 The type of the next layer.
86 <a name="boost_asio.reference.buffered_read_stream.h1"></a>
87 <span class="phrase"><a name="boost_asio.reference.buffered_read_stream.member_functions"></a></span><a class="link" href="buffered_read_stream.html#boost_asio.reference.buffered_read_stream.member_functions">Member
90 <div class="informaltable"><table class="table">
111 <a class="link" href="buffered_read_stream/async_fill.html" title="buffered_read_stream::async_fill"><span class="bold"><strong>async_fill</strong></span></a>
116 Start an asynchronous fill.
123 <a class="link" href="buffered_read_stream/async_read_some.html" title="buffered_read_stream::async_read_some"><span class="bold"><strong>async_read_some</strong></span></a>
128 Start an asynchronous read. The buffer into which the data will
129 be read must be valid for the lifetime of the asynchronous operation.
136 <a class="link" href="buffered_read_stream/async_write_some.html" title="buffered_read_stream::async_write_some"><span class="bold"><strong>async_write_some</strong></span></a>
141 Start an asynchronous write. The data being written must be valid
142 for the lifetime of the asynchronous operation.
149 <a class="link" href="buffered_read_stream/buffered_read_stream.html" title="buffered_read_stream::buffered_read_stream"><span class="bold"><strong>buffered_read_stream</strong></span></a>
154 Construct, passing the specified argument to initialise the next
162 <a class="link" href="buffered_read_stream/close.html" title="buffered_read_stream::close"><span class="bold"><strong>close</strong></span></a>
174 <a class="link" href="buffered_read_stream/fill.html" title="buffered_read_stream::fill"><span class="bold"><strong>fill</strong></span></a>
179 Fill the buffer with some data. Returns the number of bytes placed
180 in the buffer as a result of the operation. Throws an exception
184 Fill the buffer with some data. Returns the number of bytes placed
185 in the buffer as a result of the operation, or 0 if an error occurred.
192 <a class="link" href="buffered_read_stream/get_io_service.html" title="buffered_read_stream::get_io_service"><span class="bold"><strong>get_io_service</strong></span></a>
197 Get the io_service associated with the object.
204 <a class="link" href="buffered_read_stream/in_avail.html" title="buffered_read_stream::in_avail"><span class="bold"><strong>in_avail</strong></span></a>
209 Determine the amount of data that may be read without blocking.
216 <a class="link" href="buffered_read_stream/lowest_layer.html" title="buffered_read_stream::lowest_layer"><span class="bold"><strong>lowest_layer</strong></span></a>
221 Get a reference to the lowest layer.
224 Get a const reference to the lowest layer.
231 <a class="link" href="buffered_read_stream/next_layer.html" title="buffered_read_stream::next_layer"><span class="bold"><strong>next_layer</strong></span></a>
236 Get a reference to the next layer.
243 <a class="link" href="buffered_read_stream/peek.html" title="buffered_read_stream::peek"><span class="bold"><strong>peek</strong></span></a>
248 Peek at the incoming data on the stream. Returns the number of
249 bytes read. Throws an exception on failure.
252 Peek at the incoming data on the stream. Returns the number of
253 bytes read, or 0 if an error occurred.
260 <a class="link" href="buffered_read_stream/read_some.html" title="buffered_read_stream::read_some"><span class="bold"><strong>read_some</strong></span></a>
265 Read some data from the stream. Returns the number of bytes read.
266 Throws an exception on failure.
269 Read some data from the stream. Returns the number of bytes read
270 or 0 if an error occurred.
277 <a class="link" href="buffered_read_stream/write_some.html" title="buffered_read_stream::write_some"><span class="bold"><strong>write_some</strong></span></a>
282 Write the given data to the stream. Returns the number of bytes
283 written. Throws an exception on failure.
286 Write the given data to the stream. Returns the number of bytes
287 written, or 0 if an error occurred.
294 <a name="boost_asio.reference.buffered_read_stream.h2"></a>
295 <span class="phrase"><a name="boost_asio.reference.buffered_read_stream.data_members"></a></span><a class="link" href="buffered_read_stream.html#boost_asio.reference.buffered_read_stream.data_members">Data Members</a>
297 <div class="informaltable"><table class="table">
317 <a class="link" href="buffered_read_stream/default_buffer_size.html" title="buffered_read_stream::default_buffer_size"><span class="bold"><strong>default_buffer_size</strong></span></a>
322 The default buffer size.
328 The <a class="link" href="buffered_read_stream.html" title="buffered_read_stream"><code class="computeroutput"><span class="identifier">buffered_read_stream</span></code></a> class template
329 can be used to add buffering to the synchronous and asynchronous read operations
333 <a name="boost_asio.reference.buffered_read_stream.h3"></a>
334 <span class="phrase"><a name="boost_asio.reference.buffered_read_stream.thread_safety"></a></span><a class="link" href="buffered_read_stream.html#boost_asio.reference.buffered_read_stream.thread_safety">Thread
338 <span class="emphasis"><em>Distinct</em></span> <span class="emphasis"><em>objects:</em></span> Safe.
341 <span class="emphasis"><em>Shared</em></span> <span class="emphasis"><em>objects:</em></span> Unsafe.
344 <a name="boost_asio.reference.buffered_read_stream.h4"></a>
345 <span class="phrase"><a name="boost_asio.reference.buffered_read_stream.requirements"></a></span><a class="link" href="buffered_read_stream.html#boost_asio.reference.buffered_read_stream.requirements">Requirements</a>
348 <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/buffered_read_stream.hpp</code>
351 <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio.hpp</code>
354 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
355 <td align="left"></td>
356 <td align="right"><div class="copyright-footer">Copyright © 2003-2014 Christopher M. Kohlhoff<p>
357 Distributed under the Boost Software License, Version 1.0. (See accompanying
358 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
363 <div class="spirit-nav">
364 <a accesskey="p" href="buffer_size/overload5.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="buffered_read_stream/async_fill.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>