Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StreamInterface.php

function StreamInterface::read

Read data from the stream.

Parameters

int $length Read up to $length bytes from the object and return: them. Fewer than $length bytes may be returned if underlying stream call returns fewer bytes.

Return value

string Returns the data read from the stream, or an empty string if no bytes are available.

Throws

\RuntimeException if an error occurs.

5 methods override StreamInterface::read()
AppendStream::read in vendor/guzzlehttp/psr7/src/AppendStream.php
Reads from all of the appended streams until the length is met or EOF.
BufferStream::read in vendor/guzzlehttp/psr7/src/BufferStream.php
Reads data from the buffer.
FnStream::read in vendor/guzzlehttp/psr7/src/FnStream.php
Read data from the stream.
PumpStream::read in vendor/guzzlehttp/psr7/src/PumpStream.php
Read data from the stream.
Stream::read in vendor/guzzlehttp/psr7/src/Stream.php
Read data from the stream.

File

vendor/psr/http-message/src/StreamInterface.php, line 134

Class

StreamInterface
Describes a data stream.

Namespace

Psr\Http\Message

Code

public function read(int $length) : string;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal