BufferedReader
in package
uses
ForbidCloning, ForbidSerialization
FinalYes
Table of Contents
Properties
- $buffer : string
- $pending : bool
- $stream : ReadableStream
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- buffer() : string
- drain() : string
- isReadable() : bool
- read() : string|null
- readLength() : string
- readUntil() : string
- __clone() : mixed
- guard() : mixed
Properties
$buffer
private
string
$buffer
= ''
$pending
private
bool
$pending
= false
$stream
private
ReadableStream
$stream
Methods
__construct()
public
__construct(ReadableStream $stream) : mixed
Parameters
- $stream : ReadableStream
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neverbuffer()
public
buffer([Cancellation|null $cancellation = null ][, positive-int $limit = PHP_INT_MAX ]) : string
Parameters
- $cancellation : Cancellation|null = null
- $limit : positive-int = PHP_INT_MAX
Tags
Return values
stringdrain()
public
drain() : string
Return values
stringisReadable()
public
isReadable() : bool
Return values
boolread()
public
read([Cancellation|null $cancellation = null ]) : string|null
Parameters
- $cancellation : Cancellation|null = null
Tags
Return values
string|nullreadLength()
public
readLength(positive-int $length[, Cancellation|null $cancellation = null ]) : string
Parameters
- $length : positive-int
-
The number of bytes to read from the stream.
- $cancellation : Cancellation|null = null
Tags
Return values
stringreadUntil()
public
readUntil(non-empty-string $delimiter[, Cancellation|null $cancellation = null ][, positive-int $limit = PHP_INT_MAX ]) : string
Parameters
- $delimiter : non-empty-string
-
Read from the stream until the given delimiter is found in the stream, at which point all bytes up to the delimiter will be returned (but not the delimiter).
- $cancellation : Cancellation|null = null
- $limit : positive-int = PHP_INT_MAX
Tags
Return values
string__clone()
protected
final __clone() : mixed
guard()
private
guard(callable(): TString $read) : mixed
Parameters
- $read : callable(): TString