NoSeekStream.php 424 B

12345678910111213141516171819202122
  1. <?php
  2. namespace GuzzleHttp\Psr7;
  3. use Psr\Http\Message\StreamInterface;
  4. /**
  5. * Stream decorator that prevents a stream from being seeked
  6. */
  7. class NoSeekStream implements StreamInterface
  8. {
  9. use StreamDecoratorTrait;
  10. public function seek($offset, $whence = SEEK_SET)
  11. {
  12. throw new \RuntimeException('Cannot seek a NoSeekStream');
  13. }
  14. public function isSeekable()
  15. {
  16. return false;
  17. }
  18. }