118 $limit = ($length !==
null)
119 ? ($stream->tell() + $length)
122 while ($limit ===
null || $stream->tell() < $limit) {
124 if ($stream->eof()) {
128 $key = $reader->readVarint($stream);
129 $wire = \Protobuf\WireFormat::getTagWireType(
$key);
130 $tag = \Protobuf\WireFormat::getTagFieldNumber(
$key);
132 if ($stream->eof()) {
139 if ($extension !==
null) {
149 $data = $reader->readUnknown($stream, $wire);
150 $unknown = new \Protobuf\Unknown($tag, $wire,
$data);