ut sequence
</pre>
<p>
        Reading from a socket directly into a streambuf:
      </p>
<pre class="programlisting">boost::asio::streambuf b;

// reserve 512 bytes in output sequence
boost::asio::streambuf::mutable_buffers_type bufs = b.prepare(512);

size_t n = sock.receive(bufs);

// received data is "committed" from output sequence to input sequence
b.commit(n);

std::istream is(&amp;b);
std::string s;
is &gt;&gt; s;
</pre>
<h5>
<a name="boost_asio.reference.basic_streambuf.h4"></a>
        <span clas