stream = $stream; } public function seek($position) { $this->stream->seek($position); } public function skip($bytes) { $this->stream->skip($bytes); } // read little endian 32-bit integer public function readUInt32() { $t = unpack("V", $this->stream->readBytes(4)); return $t[1]; } public function readUInt16() { $t = unpack("v", $this->stream->readBytes(2)); return $t[1]; } public function readByte() { $t = unpack("C", $this->stream->readBytes(1)); return $t[1]; } public function readBytes($size) { return $this->stream->readBytes($size); } public function eof() { return $this->stream->eof(); } }