Exemplo n.º 1
0
 public function __toString()
 {
     return '' . Protobuf::toString('unknown', $this->_unknown) . Protobuf::toString('key_', $this->key_) . Protobuf::toString('value_', $this->value_);
 }
Exemplo n.º 2
0
 public function __toString()
 {
     return '' . Protobuf::toString('unknown', $this->_unknown) . Protobuf::toString('logs_', $this->logs_) . Protobuf::toString('reserved_', $this->reserved_) . Protobuf::toString('topic_', $this->topic_) . Protobuf::toString('source_', $this->source_);
 }
Exemplo n.º 3
0
 /**
  * Read a unknown field from the stream and return its raw bytes
  */
 public static function read_field($fp, $wire_type, &$limit = null)
 {
     switch ($wire_type) {
         case 0:
             // varint
             return Protobuf::read_varint($fp, $limit);
         case 1:
             // 64bit
             $limit -= 8;
             return fread($fp, 8);
         case 2:
             // length delimited
             $len = Protobuf::read_varint($fp, $limit);
             $limit -= $len;
             return fread($fp, $len);
             //case 3: // Start group TODO we must keep looping until we find the closing end grou
             //case 4: // End group - We should never skip a end group!
             //	return 0; // Do nothing
         //case 3: // Start group TODO we must keep looping until we find the closing end grou
         //case 4: // End group - We should never skip a end group!
         //	return 0; // Do nothing
         case 5:
             // 32bit
             $limit -= 4;
             return fread($fp, 4);
         default:
             throw new Exception('read_unknown(' . ProtoBuf::get_wiretype($wire_type) . '): Unsupported wire_type');
     }
 }
Exemplo n.º 4
0
 public function __toString()
 {
     return '' . Protobuf::toString('unknown', $this->_unknown) . Protobuf::toString('time_', $this->time_) . Protobuf::toString('contents_', $this->contents_);
 }