A stream whose data is seekable.
SeekableStream::seek( int $offset, int $whence = SEEK_SET, float $timeout = 0 ): \Generator
Moves the pointer to a new position in the stream. The
$whence parameter is identical the parameter of the same name on the built-in
- Number of bytes to seek. Usage depends on value of
- Values identical to
- Number of seconds until the coroutine is rejected with a
Icicle\Awaitable\Exception\TimeoutExceptionand the stream is closed if the seek could not be performed. Use
0for no timeout.
- New pointer position.
- If the stream has become unseekable. Use
isSeekable()to determine if a stream is still seekable.
- If the seek timed out.
- If the stream is closed while the seek is still pending.
Returns the current pointer position. Value returned may not reflect the future pointer position if a read, write, or seek operation is pending.
- Current pointer position (may not reflect pending seek or write operations.
- Returns the total length of the stream if known, otherwise -1. Value returned may not reflect a pending write operation.