Lines Matching refs:offset
17 private $offset; variable in GuzzleHttp\\Psr7\\LimitStream
29 * @param int $offset Position to seek to before reading (only
35 int $offset = 0 argument
39 $this->setOffset($offset);
54 return $this->stream->tell() >= $this->offset + $this->limit;
65 return $length - $this->offset;
67 return min($this->limit, $length - $this->offset);
74 public function seek($offset, $whence = SEEK_SET): void argument
76 if ($whence !== SEEK_SET || $offset < 0) {
79 $offset,
84 $offset += $this->offset;
87 if ($offset > $this->offset + $this->limit) {
88 $offset = $this->offset + $this->limit;
92 $this->stream->seek($offset);
100 return $this->stream->tell() - $this->offset;
106 * @param int $offset Offset to seek to and begin byte limiting from
110 public function setOffset(int $offset): void argument
114 if ($current !== $offset) {
117 $this->stream->seek($offset);
118 } elseif ($current > $offset) {
119 throw new \RuntimeException("Could not seek to stream offset $offset");
121 $this->stream->read($offset - $current);
125 $this->offset = $offset;
148 $remaining = ($this->offset + $this->limit) - $this->stream->tell();