body = $body; $this->length = strlen($body); } public function getLength(): int { return $this->length; } public function getPosition(): int { return $this->position; } public function stepBack(): void { $this->position = max(0, $this->position - 1); } public function readByte(): int { if($this->position + 1 >= $this->length) return 0xFF; return ord($this->body[$this->position++]); } }