/** * Parse the header for a tree bag. */ protected function parseTree() { $this->fileId = Binary::unpackLong(substr($this->deserialized, $this->offset, 8)); $this->binaryOffset += 8; $this->pageIndex = Binary::unpackLong(substr($this->deserialized, $this->offset, 8)); $this->binaryOffset += 8; $this->pageOffset = Binary::unpackInt(substr($this->deserialized, $this->offset, 4)); $this->binaryOffset += 4; $this->size = Binary::unpackInt(substr($this->deserialized, $this->offset, 4)); $this->binaryOffset += 4; $this->changeSize = Binary::unpackInt(substr($this->deserialized, $this->offset, 4)); $this->binaryOffset += 4; }
/** * Read an integer from the socket. * * @return int the integer read */ protected function readInt() { return Binary::unpackInt($this->socket->read(4)); }