public static function readFrom(Reader $file, TAG_Array $into = null) { \tool::fprint("Reading ... " . get_called_class() . "::" . __FUNCTION__); $self = $into ?: new static(); $size = TAG_Int::readFrom($file); for ($i = 0; $i < $size; $i++) { $self[] = TAG_Byte::readFrom($file); } return $self; }
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 static function readFrom(Reader $file, TAG_Array $into = null) { \tool::fprint("Reading ... " . get_called_class() . "::" . __FUNCTION__); $self = $into ?: new static(); $size = TAG_Int::readFrom($file); if (\tool::debug()) { \tool::fprint("Reading " . $size . " items."); } for ($i = 0; $i < $size; $i++) { $self[] = TAG_Int::readFrom($file); } if (\tool::debug()) { \tool::fprint("Read " . count($self) . " items."); } return $self; }