/**
* {@inheritdoc}
*/
public function readFrom(\Protobuf\ReadContext $context)
{
$reader = $context->getReader();
$length = $context->getLength();
$stream = $context->getStream();
$limit = $length !== null ? $stream->tell() + $length : null;
while ($limit === null || $stream->tell() < $limit) {
if ($stream->eof()) {
break;
}
$key = $reader->readVarint($stream);
$wire = \Protobuf\WireFormat::getTagWireType($key);
$tag = \Protobuf\WireFormat::getTagFieldNumber($key);
if ($stream->eof()) {
break;
}
if ($tag === 1) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->asset_id = $reader->readString($stream);
continue;
}
if ($tag === 2) {
\Protobuf\WireFormat::assertWireType($wire, 9);
$this->bundle_name = $reader->readString($stream);
continue;
}
if ($tag === 3) {
\Protobuf\WireFormat::assertWireType($wire, 3);
$this->version = $reader->readVarint($stream);
continue;
}
if ($tag === 4) {
\Protobuf\WireFormat::assertWireType($wire, 7);
$this->checksum = $reader->readFixed32($stream);
continue;
}
if ($tag === 5) {
\Protobuf\WireFormat::assertWireType($wire, 5);
$this->size = $reader->readVarint($stream);
continue;
}
if ($tag === 6) {
\Protobuf\WireFormat::assertWireType($wire, 12);
$this->key = $reader->readByteStream($stream);
continue;
}
$extensions = $context->getExtensionRegistry();
$extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
if ($extension !== null) {
$this->extensions()->add($extension, $extension->readFrom($context, $wire));
continue;
}
if ($this->unknownFieldSet === null) {
$this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
}
$data = $reader->readUnknown($stream, $wire);
$unknown = new \Protobuf\Unknown($tag, $wire, $data);
$this->unknownFieldSet->add($unknown);
}
}