Lines Matching defs:offset

62      * The byte-offset position in the stream.
69 * The byte-offset position in the buffer.
73 protected $offset;
152 return $this->bufferLength - $this->offset;
177 $string = \substr($this->buffer, $this->offset);
187 * If the $position parameter is set to null the value of $this->offset will be used.
194 $position = (int) ($position !== null ? $position : $this->offset);
205 * Returns a byte at a specific position, and set the offset to the next byte position.
209 * If the $position parameter is set to null the value of $this->offset will be used.
221 $offset = $this->offset;
223 $offset = $position - $this->position;
226 $offset = $this->offset;
229 if ($offset >= $this->bufferLength &&
230 ((!$this->increaseLength()) || $offset >= $this->bufferLength)
235 $this->offset = $offset + 1;
236 return $this->buffer[$offset];
240 * Read bytes from the current or a specific offset position and set the internal pointer to the next byte.
244 * If the $position parameter is set to null the value of $this->offset will be used.
257 $offset = $this->offset;
259 $offset = $position - $this->position;
262 $offset = $this->offset;
265 if (($offset + $length) > $this->bufferLength &&
266 ((!$this->increaseLength($length)) || ($offset + $length) > $this->bufferLength)
271 $bytes = \substr($this->buffer, $offset, $length);
272 $this->offset = $offset + $length;
315 * Set the offset position in the current buffer.
317 * @param int $offset
319 public function setOffset($offset)
321 if ($offset > $this->bufferLength || $offset < 0) {
323 \sprintf('Offset (%s) out of range (length: %s)', $offset, $this->bufferLength)
327 $this->offset = (int) $offset;
331 * Returns the current offset in the current buffer.
337 return $this->offset;
341 * Add an offset to the current offset.
343 * @param int $offset
345 public function addOffset($offset)
347 $this->setOffset($this->offset + $offset);
351 * Make sure that there is at least one character beyond the current offset in the buffer.
357 while ($this->offset >= $this->bufferLength) {
405 $pos = $this->position + $this->offset;
415 $this->offset = 0;
440 $this->offset = $pos - $this->position;