Skip to content

Commit

Permalink
Merge pull request #100 from php-http/feature/not-seekable-filtered-s…
Browse files Browse the repository at this point in the history
…tream

Filtered Stream is not seekable
  • Loading branch information
sagikazarmark authored Oct 29, 2018
2 parents 923ed1f + a64944c commit a469988
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Encoding/FilteredStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,30 @@ public function __toString()
return $this->getContents();
}

/**
* {@inheritdoc}
*/
public function isSeekable()
{
return false;
}

/**
* {@inheritdoc}
*/
public function rewind()
{
throw new \RuntimeException('Cannot rewind a filtered stream');
}

/**
* {@inheritdoc}
*/
public function seek($offset, $whence = SEEK_SET)
{
throw new \RuntimeException('Cannot seek a filtered stream');
}

/**
* Returns the read filter name.
*
Expand Down

0 comments on commit a469988

Please sign in to comment.