<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="eventbuffer.read" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>EventBuffer::read</refname>
  <refpurpose>Read data from an evbuffer and drain the bytes read</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier>
   <type>string</type>
   <methodname>EventBuffer::read</methodname>
   <methodparam>
    <type>int</type>
    <parameter>max_bytes</parameter>
   </methodparam>
  </methodsynopsis>
  <para>
   Read the first
   <parameter>max_bytes</parameter>
   from the buffer and drain the bytes read. If more
   <parameter>max_bytes</parameter>
   are requested than are available in the buffer, it only extracts as many
   bytes as available.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term>
     <parameter>max_bytes</parameter>
    </term>
    <listitem>
     <para>
      Maxmimum number of bytes to read from the buffer.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns string read, or &false; on failure.
  </para>
 </refsect1>
 <refsect1 role="changelog">
  &reftitle.changelog;
  <para>
   <informaltable>
    <tgroup cols="2">
     <thead>
      <row>
       <entry>&Version;</entry>
       <entry>&Description;</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry>PECL event 1.6.0</entry>
       <entry>
        Renamed <methodname>EventBuffer::read</methodname>(the old method
        name) to <methodname>EventBuffer::read</methodname>.
        <methodname>EventBuffer::read</methodname> now takes only
        <parameter>max_bytes</parameter> argument; returns string instead of
        integer.
       </entry>
      </row>
     </tbody>
    </tgroup>
   </informaltable>
  </para>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member>
    <methodname>EventBuffer::copyout</methodname>
   </member>
   <member>
    <methodname>EventBuffer::drain</methodname>
   </member>
   <member>
    <methodname>EventBuffer::pullup</methodname>
   </member>
   <member>
    <methodname>EventBuffer::readLine</methodname>
   </member>
   <member>
    <methodname>EventBuffer::appendFrom</methodname>
   </member>
  </simplelist>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
