Nexus API Reference

IteratorStream
in package
implements StreamInterface

FinalYes
Tags
psalm-api

PSR-7 StreamInterface backed by an Iterator. Each read() pulls one yielded chunk. Designed for server adapters that want to flush per chunk (Swoole's Response::write loop). Non-seekable; read-only.

Table of Contents

Interfaces

StreamInterface

Methods

__construct()  : mixed
__toString()  : string
close()  : void
detach()  : mixed
eof()  : bool
getContents()  : string
getMetadata()  : mixed
getSize()  : int|null
isReadable()  : bool
isSeekable()  : bool
isWritable()  : bool
read()  : string
rewind()  : void
seek()  : void
tell()  : int
write()  : int

Methods

__construct()

public __construct(Iterator $iterator) : mixed
Parameters
$iterator : Iterator

getContents()

public getContents() : string
Return values
string

getMetadata()

public getMetadata([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

read()

public read(int $length) : string
Parameters
$length : int
Return values
string

seek()

public seek(int $offset[, int $whence = SEEK_SET ]) : void
Parameters
$offset : int
$whence : int = SEEK_SET

write()

public write(string $string) : int
Parameters
$string : string
Return values
int

        
On this page

Search results