public static function readFrom(Reader $file, TAG_Array $into = null) { $self = $into ?: new static(); $type = $self->type = Dictionary::mapType($file->fread(1)); $size = TAG_Int::readFrom($file); if (\tool::debug()) { \tool::fprint("Reading {$size} elements of type {$self->type}"); } for ($i = 0; $i < $size; $i++) { $self[] = $type::readFrom($file); } return $self; }
public final function read() { $_type = Dictionary::mapType($this->fread(1)); return $_type::createFrom($this); }