Lines Matching refs:position

62      * The byte-offset position in the stream.
66 protected $position;
69 * The byte-offset position in the buffer.
156 * Get the current position in the stream.
162 return $this->position;
183 * Gets a byte at a specific position in the buffer.
185 * If the position is invalid the method will return false.
187 * If the $position parameter is set to null the value of $this->offset will be used.
189 * @param int|null $position
192 public function getByte($position = null)
194 $position = (int) ($position !== null ? $position : $this->offset);
195 if ($position >= $this->bufferLength &&
196 (!$this->increaseLength() || $position >= $this->bufferLength)
201 return $this->buffer[$position];
205 * Returns a byte at a specific position, and set the offset to the next byte position.
207 * If the position is invalid the method will return false.
209 * If the $position parameter is set to null the value of $this->offset will be used.
211 * @param int|null $position
214 public function readByte($position = null)
216 if ($position !== null) {
217 $position = (int) $position;
219 if (!($position >= $this->position && $position < $this->position + $this->bufferLength)) {
220 $this->reset($position);
223 $offset = $position - $this->position;
240 * Read bytes from the current or a specific offset position and set the internal pointer to the next byte.
242 * If the position is invalid the method will return false.
244 * If the $position parameter is set to null the value of $this->offset will be used.
247 * @param int|null $position
250 public function readBytes($length, $position = null)
253 if ($position !== null) {
255 if (!($position >= $this->position && $position < $this->position + $this->bufferLength)) {
256 $this->reset($position, $length);
259 $offset = $position - $this->position;
278 * Read a line from the current position.
315 * Set the offset position in the current buffer.
391 * Resets the buffer to a position and re-read the buffer with the given length.
393 * If the $pos parameter is negative the start buffer position will be the $pos'th position from
399 * @param int|null $pos Start position of the new buffer
405 $pos = $this->position + $this->offset;
412 $this->position = $pos;
436 if ($pos >= $this->position
437 && $pos < ($this->position + $this->bufferLength)
438 && ($this->position + $this->bufferLength) >= ($pos + $length)
440 $this->offset = $pos - $this->position;
456 if (\feof($this->stream) || $this->getTotalLength() === $this->position + $this->bufferLength) {