Documentation

LimitStream
in package
implements StreamInterface Uses AStreamDecoratorTrait

Interfaces, Classes, Traits and Enums

StreamInterface
Describes a data stream.

Table of Contents

$limit  : mixed
$offset  : mixed
__call()  : mixed
__construct()  : mixed
__get()  : mixed
__toString()  : mixed
close()  : mixed
detach()  : mixed
eof()  : bool
Returns true if the stream is at the end of the stream.
getContents()  : mixed
getMetadata()  : mixed
getSize()  : int|null
Get the size of the stream if known.
isReadable()  : mixed
isSeekable()  : mixed
isWritable()  : mixed
read()  : string
Read data from the stream.
rewind()  : mixed
seek()  : mixed
Seek to a position in the stream.
setLimit()  : mixed
setOffset()  : mixed
tell()  : int
Returns the current position of the file read/write pointer
write()  : mixed
createStream()  : mixed

Properties

Methods

__call()

public __call(mixed $method, array<string|int, mixed> $args) : mixed
Parameters
$method : mixed
$args : array<string|int, mixed>
Return values
mixed

__construct()

public __construct(StreamInterface $stream[, mixed $limit = -1 ], mixed $offset) : mixed
Parameters
$stream : StreamInterface
$limit : mixed = -1
$offset : mixed
Return values
mixed

eof()

Returns true if the stream is at the end of the stream.

public eof() : bool
Return values
bool

getMetadata()

public getMetadata([mixed $key = null ]) : mixed
Parameters
$key : mixed = null
Return values
mixed

getSize()

Get the size of the stream if known.

public getSize() : int|null
Return values
int|null

Returns the size in bytes if known, or null if unknown.

read()

Read data from the stream.

public read(mixed $length) : string
Parameters
$length : mixed

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 values
string

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

seek()

Seek to a position in the stream.

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

Stream offset

$whence : mixed = SEEK_SET

Specifies how the cursor position will be calculated based on the seek offset. Valid values are identical to the built-in PHP $whence values for fseek(). SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset.

Return values
mixed

setLimit()

public setLimit(mixed $limit) : mixed
Parameters
$limit : mixed
Return values
mixed

setOffset()

public setOffset(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

tell()

Returns the current position of the file read/write pointer

public tell() : int
Return values
int

Position of the file pointer

write()

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

Search results