mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
* Updates to abandoned/outdated pages in reference/array/functions/ * Updates to outdated/abandoned pages and new translations in reference/classobj/ * Updates to abandoned/outdated pages in reference/ctype/ * Correction to double-byte UTF-8 character which is similar to 'E' * Correction of translation * Updates to abandoned/outdated files and new translations in reference/dir/ * Updates to abandoned/outdated files in reference/mysqli/ * New translation of reference/sockets/functions/socket-atmark.xml * New translation of reference/stream/* * Corrections after QA scripts * Delete reference/stream/versions.xml Arquivo marcado para não tradução. --------- Co-authored-by: LEONARDO LARA RODRIGUES <leonardolara@github.com> Co-authored-by: alfsb <alfsb@users.noreply.github.com>
147 lines
3.9 KiB
XML
147 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 906db3b3f78cfa98a7453e3910bcba95bc66d1ee Maintainer: leonardolara Status: ready -->
|
|
|
|
<refentry xml:id="streamwrapper.stream-read" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>streamWrapper::stream_read</refname>
|
|
<refpurpose>Lê dados do fluxo</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>streamWrapper::stream_read</methodname>
|
|
<methodparam><type>int</type><parameter>count</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Este método é chamado em resposta a <function>fread</function>
|
|
e <function>fgets</function>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Lembre-se de atualizar a posição de leitura/escrita do fluxo (com o número de
|
|
bytes lidos com sucesso).
|
|
</para>
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>count</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Quantos bytes de dados da posição atual devem ser retornados.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Se houver menos bytes disponíveis que <parameter>count</parameter>,
|
|
devem ser retornados quantos estiverem disponíveis.
|
|
Se não houver mais dados, uma string vazia deve ser retornada.
|
|
Para sinalizar que a leitura falhou, &false; deve ser retornado.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors"><!-- {{{ -->
|
|
&reftitle.errors;
|
|
&userstream.not.implemented.warning;
|
|
<note>
|
|
<para>
|
|
Se o valor de retorno for maior que <parameter>count</parameter>, um aviso
|
|
<constant>E_WARNING</constant> será emitido, e os dados excedentes serão
|
|
perdidos.
|
|
</para>
|
|
</note>
|
|
</refsect1><!-- }}} -->
|
|
|
|
|
|
<!--
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>streamWrapper::stream_read</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* ... */
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
...
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
-->
|
|
|
|
<refsect1 role="notes"><!-- {{{ -->
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
<methodname>streamWrapper::stream_eof</methodname> é chamado diretamente após a
|
|
chamada a <methodname>streamWrapper::stream_read</methodname> para verificar se
|
|
<acronym>EOF</acronym> foi alcançado. Se não implementado,
|
|
<acronym>EOF</acronym> é assumido.
|
|
</para>
|
|
</note>
|
|
<warning>
|
|
<para>
|
|
Ao ler todo o arquivo (por exemplo, com
|
|
<function>file_get_contents</function>), o PHP irá chamar
|
|
<methodname>streamWrapper::stream_read</methodname> seguido por
|
|
<methodname>streamWrapper::stream_eof</methodname> em um loop, mas enquanto
|
|
<methodname>streamWrapper::stream_read</methodname> retornar uma
|
|
string não vazia, o valor de retorno de
|
|
<methodname>streamWrapper::stream_eof</methodname> será ignorado.
|
|
</para>
|
|
</warning>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>fread</function></member>
|
|
<member><function>fgets</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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
|
|
-->
|