Lines Matching +full:s +full:- +full:tell
28 * from the stream. Pass -1 for no limit.
34 int $limit = -1,
37 $this->stream = $stream;
38 $this->setLimit($limit);
39 $this->setOffset($offset);
45 if ($this->stream->eof()) {
50 if ($this->limit === -1) {
54 return $this->stream->tell() >= $this->offset + $this->limit;
62 if (null === ($length = $this->stream->getSize())) {
64 } elseif ($this->limit === -1) {
65 return $length - $this->offset;
67 return min($this->limit, $length - $this->offset);
78 'Cannot seek to offset %s with whence %s',
84 $offset += $this->offset;
86 if ($this->limit !== -1) {
87 if ($offset > $this->offset + $this->limit) {
88 $offset = $this->offset + $this->limit;
92 $this->stream->seek($offset);
96 * Give a relative tell()
98 public function tell(): int function in GuzzleHttp\\Psr7\\LimitStream
100 return $this->stream->tell() - $this->offset;
112 $current = $this->stream->tell();
116 if ($this->stream->isSeekable()) {
117 $this->stream->seek($offset);
121 $this->stream->read($offset - $current);
125 $this->offset = $offset;
133 * Use -1 for no limit.
137 $this->limit = $limit;
142 if ($this->limit === -1) {
143 return $this->stream->read($length);
148 $remaining = ($this->offset + $this->limit) - $this->stream->tell();
152 return $this->stream->read(min($remaining, $length));