Files
AuthProxy/vendor/workerman/psr7/src/NoSeekStream.php
T
2024-08-09 17:43:48 +08:00

23 lines
443 B
PHP

<?php
namespace Workerman\Psr7;
use Psr\Http\Message\StreamInterface;
/**
* Stream decorator that prevents a stream from being seeked
*/
class NoSeekStream implements StreamInterface
{
use StreamDecoratorTrait;
public function seek(int $offset, int $whence = SEEK_SET): void
{
throw new \RuntimeException('Cannot seek a NoSeekStream');
}
public function isSeekable(): bool
{
return false;
}
}