Пример #1
0
 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;
 }
Пример #2
0
 public final function read()
 {
     $_type = Dictionary::mapType($this->fread(1));
     return $_type::createFrom($this);
 }