Skip to content

Commit a469988

Browse files
Merge pull request #100 from php-http/feature/not-seekable-filtered-stream
Filtered Stream is not seekable
2 parents 923ed1f + a64944c commit a469988

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/Encoding/FilteredStream.php

+24
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,30 @@ public function __toString()
161161
return $this->getContents();
162162
}
163163

164+
/**
165+
* {@inheritdoc}
166+
*/
167+
public function isSeekable()
168+
{
169+
return false;
170+
}
171+
172+
/**
173+
* {@inheritdoc}
174+
*/
175+
public function rewind()
176+
{
177+
throw new \RuntimeException('Cannot rewind a filtered stream');
178+
}
179+
180+
/**
181+
* {@inheritdoc}
182+
*/
183+
public function seek($offset, $whence = SEEK_SET)
184+
{
185+
throw new \RuntimeException('Cannot seek a filtered stream');
186+
}
187+
164188
/**
165189
* Returns the read filter name.
166190
*

0 commit comments

Comments
 (0)