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
$limit
private
mixed
$limit
$offset
private
mixed
$offset
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 —__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__toString()
public
__toString() : mixed
Return values
mixed —close()
public
close() : mixed
Return values
mixed —detach()
public
detach() : mixed
Return values
mixed —eof()
Returns true if the stream is at the end of the stream.
public
eof() : bool
Return values
bool —getContents()
public
getContents() : mixed
Return values
mixed —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.
isReadable()
public
isReadable() : mixed
Return values
mixed —isSeekable()
public
isSeekable() : mixed
Return values
mixed —isWritable()
public
isWritable() : mixed
Return values
mixed —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.
rewind()
public
rewind() : mixed
Return values
mixed —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 —createStream()
protected
createStream() : mixed