/**
  * {@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 === 2) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->allow_alias = $reader->readBool($stream);
             continue;
         }
         if ($tag === 3) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->deprecated = $reader->readBool($stream);
             continue;
         }
         if ($tag === 999) {
             \Protobuf\WireFormat::assertWireType($wire, 11);
             $innerSize = $reader->readVarint($stream);
             $innerMessage = new \google\protobuf\UninterpretedOption();
             if ($this->uninterpreted_option === null) {
                 $this->uninterpreted_option = new \Protobuf\MessageCollection();
             }
             $this->uninterpreted_option->add($innerMessage);
             $context->setLength($innerSize);
             $innerMessage->readFrom($context);
             $context->setLength($length);
             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);
     }
 }
 /**
  * {@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->java_package = $reader->readString($stream);
             continue;
         }
         if ($tag === 8) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->java_outer_classname = $reader->readString($stream);
             continue;
         }
         if ($tag === 10) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->java_multiple_files = $reader->readBool($stream);
             continue;
         }
         if ($tag === 20) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->java_generate_equals_and_hash = $reader->readBool($stream);
             continue;
         }
         if ($tag === 27) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->java_string_check_utf8 = $reader->readBool($stream);
             continue;
         }
         if ($tag === 9) {
             \Protobuf\WireFormat::assertWireType($wire, 14);
             $this->optimize_for = \google\protobuf\FileOptions\OptimizeMode::valueOf($reader->readVarint($stream));
             continue;
         }
         if ($tag === 11) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->go_package = $reader->readString($stream);
             continue;
         }
         if ($tag === 16) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->cc_generic_services = $reader->readBool($stream);
             continue;
         }
         if ($tag === 17) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->java_generic_services = $reader->readBool($stream);
             continue;
         }
         if ($tag === 18) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->py_generic_services = $reader->readBool($stream);
             continue;
         }
         if ($tag === 23) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->deprecated = $reader->readBool($stream);
             continue;
         }
         if ($tag === 31) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->cc_enable_arenas = $reader->readBool($stream);
             continue;
         }
         if ($tag === 36) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->objc_class_prefix = $reader->readString($stream);
             continue;
         }
         if ($tag === 37) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->csharp_namespace = $reader->readString($stream);
             continue;
         }
         if ($tag === 38) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->javanano_use_deprecated_package = $reader->readBool($stream);
             continue;
         }
         if ($tag === 999) {
             \Protobuf\WireFormat::assertWireType($wire, 11);
             $innerSize = $reader->readVarint($stream);
             $innerMessage = new \google\protobuf\UninterpretedOption();
             if ($this->uninterpreted_option === null) {
                 $this->uninterpreted_option = new \Protobuf\MessageCollection();
             }
             $this->uninterpreted_option->add($innerMessage);
             $context->setLength($innerSize);
             $innerMessage->readFrom($context);
             $context->setLength($length);
             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);
     }
 }