title: Boost streambuf and write weird behaviour
body: <p>I am using streambuf as a storage for serial port communication</p>
  
  <pre><code>io_service io;
  serial_port sp(io);
  sp.open("COM4");
  sp.set_option( serial_port_base::baud_rate( 115200 ) );
  sp.set_option( serial_port_base::character_size( 8 ) );
  sp.set_option( serial_port_base::stop_bits( serial_port_base::stop_bits::one )  );
  sp.set_option( serial_port_base::parity( serial_port_base::parity::none ) );
  sp.set_option( serial_port_base::flow_control( serial_port_base::flow_control::none )   );
  boost::asio::streambuf buffer;
  // Fill buffer here
  auto size = buffer.size();
  std::cout &lt;&lt; boost::format("Buffer size: %d") % size &lt;&lt; std::endl;
  boost::asio::write( sp, buffer );
  size = buffer.size();
  std::cout &lt;&lt; boost::format("Buffer size: %d" ) % size &lt;&lt; std::endl;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Buffer size: 8
  Buffer size: 0
  </code></pre>
  
  <p>Why method <code>size()</code> return different values?</p>