NoSeekStream
in package
implements
StreamInterface
Uses
StreamDecoratorTrait
FinalYes
Stream decorator that prevents a stream from being seeked.
Table of Contents
Interfaces
- StreamInterface
- Describes a data stream.
Methods
- __call() : mixed
- Allow decorators to implement custom methods
- __construct() : mixed
- __get() : StreamInterface
- Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).
- __toString() : string
- close() : void
- detach() : mixed
- eof() : bool
- getContents() : string
- getMetadata() : mixed
- getSize() : int|null
- isReadable() : bool
- isSeekable() : bool
- Returns whether or not the stream is seekable.
- isWritable() : bool
- read() : string
- rewind() : void
- seek() : void
- Seek to a position in the stream.
- tell() : int
- write() : int
Methods
__call()
Allow decorators to implement custom methods
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
public
__construct(StreamInterface $stream) : mixed
Parameters
- $stream : StreamInterface
-
Stream to decorate
__get()
Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).
public
__get(string $name) : StreamInterface
Parameters
- $name : string
Return values
StreamInterface__toString()
public
__toString() : string
Return values
stringclose()
public
close() : void
detach()
public
detach() : mixed
eof()
public
eof() : bool
Return values
boolgetContents()
public
getContents() : string
Return values
stringgetMetadata()
public
getMetadata([mixed $key = null ]) : mixed
Parameters
- $key : mixed = null
getSize()
public
getSize() : int|null
Return values
int|nullisReadable()
public
isReadable() : bool
Return values
boolisSeekable()
Returns whether or not the stream is seekable.
public
isSeekable() : bool
Return values
boolisWritable()
public
isWritable() : bool
Return values
boolread()
public
read(mixed $length) : string
Parameters
- $length : mixed
Return values
stringrewind()
public
rewind() : void
seek()
Seek to a position in the stream.
public
seek(mixed $offset[, mixed $whence = SEEK_SET ]) : void
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.
tell()
public
tell() : int
Return values
intwrite()
public
write(mixed $string) : int
Parameters
- $string : mixed