pocketmine\nbt\NBT::read PHP Метод

read() публичный Метод

public read ( $buffer, $doMultiple = false )
    public function read($buffer, $doMultiple = false)
    {
        $this->offset = 0;
        $this->buffer = $buffer;
        $this->data = $this->readTag();
        if ($doMultiple and $this->offset < strlen($this->buffer)) {
            $this->data = [$this->data];
            do {
                $this->data[] = $this->readTag();
            } while ($this->offset < strlen($this->buffer));
        }
        $this->buffer = "";
    }

Usage Example

Пример #1
0
 private static function parseCompoundTag(string $tag) : CompoundTag
 {
     if (self::$cachedParser === null) {
         self::$cachedParser = new NBT(NBT::LITTLE_ENDIAN);
     }
     self::$cachedParser->read($tag);
     return self::$cachedParser->getData();
 }
All Usage Examples Of pocketmine\nbt\NBT::read