readByte example

/** * @return int */
    public function readByte() { // 8-bit         return ord(substr($this->bytes, $this->pos++, 1));
    }

    /** * @return int */
    public function readInt() { // 16-bit         return ($this->readByte() << 8) + $this->readByte();
    }

    /** * @return int */
    public function readLong() { // 32-bit         return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte();
    }

    /** * @return float|false */
Home | Imprint | This part of the site doesn't use cookies.