\Psc\Std\StreamStream

Summary

Methods
Properties
Constants
__construct()
close()
read()
write()
eof()
seek()
rewind()
detach()
getSize()
tell()
ftell()
isSeekable()
isWritable()
isReadable()
getMetadata()
__toString()
getContents()
$stream
$id
$meta
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$stream

$stream : resource

Type

resource

$id

$id : int

Type

int

$meta

$meta : array

Type

array

Methods

__construct()

__construct(resource  $resource) : mixed

Stream constructor.

Parameters

resource $resource

Returns

mixed —

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 —