Properties

$stream

$stream : resource

Type

resource

$id

$id : int

Type

int

$meta

$meta : array

Type

array

$onReadable

$onReadable : string[]

Type

string[]

$onWritable

$onWritable : string[]

Type

string[]

$onCloseCallbacks

$onCloseCallbacks : array

Type

array

Methods

__construct()

__construct(resource  $resource) : mixed

Stream constructor.

Parameters

resource $resource

Returns

mixed —

onClose()

onClose(\Closure  $closure) : void

Parameters

\Closure $closure

onReadable()

onReadable(\Closure  $closure) : string

Parameters

\Closure $closure

Returns

string —

onWritable()

onWritable(\Closure  $closure) : string

Parameters

\Closure $closure

Returns

string —

setBlocking()

setBlocking(bool  $bool) : bool

Parameters

bool $bool

Returns

bool —

close()

close() : void

read()

read(int|null  $length) : string

Parameters

int|null $length

Throws

\Psc\Std\Stream\Exception\ConnectionException

Returns

string —

write()

write(string  $string) : int

Parameters

string $string

Throws

\Psc\Std\Stream\Exception\ConnectionException

Returns

int —

eof()

eof() : bool

Returns

bool —

seek()

seek(int  $offset, int  $whence = SEEK_SET) : void

移动指定位置指针

Parameters

int $offset
int $whence

rewind()

rewind() : void

detach()

detach() : mixed

Returns

mixed —

getSize()

getSize() : int|null

Returns

int|null —

tell()

tell() : int

Returns

int —

ftell()

ftell() : int|false

Returns

int|false —

isSeekable()

isSeekable() : bool

Returns

bool —

isWritable()

isWritable() : bool

Returns

bool —

isReadable()

isReadable() : bool

Returns

bool —

getMetadata()

getMetadata(string|null  $key = null) : mixed

Parameters

string|null $key

Returns

mixed —

__toString()

__toString() : string

Returns

string —

getContents()

getContents() : string

Returns

string —