Esempio n. 1
0
 function write($fp)
 {
     if (!$this->validateRequired()) {
         throw new Exception('Required fields are missing');
     }
     if (!is_null($this->time_)) {
         fwrite($fp, "");
         Protobuf::write_varint($fp, $this->time_);
     }
     if (!is_null($this->contents_)) {
         foreach ($this->contents_ as $v) {
             fwrite($fp, "");
             Protobuf::write_varint($fp, $v->size());
             // message
             $v->write($fp);
         }
     }
 }
Esempio n. 2
0
 function write($fp)
 {
     if (!$this->validateRequired()) {
         throw new Exception('Required fields are missing');
     }
     if (!is_null($this->key_)) {
         fwrite($fp, "\n");
         Protobuf::write_varint($fp, strlen($this->key_));
         fwrite($fp, $this->key_);
     }
     if (!is_null($this->value_)) {
         fwrite($fp, "");
         Protobuf::write_varint($fp, strlen($this->value_));
         fwrite($fp, $this->value_);
     }
 }
Esempio n. 3
0
 function write($fp)
 {
     if (!$this->validateRequired()) {
         throw new Exception('Required fields are missing');
     }
     if (!is_null($this->logs_)) {
         foreach ($this->logs_ as $v) {
             fwrite($fp, "\n");
             Protobuf::write_varint($fp, $v->size());
             // message
             $v->write($fp);
         }
     }
     if (!is_null($this->reserved_)) {
         fwrite($fp, "");
         Protobuf::write_varint($fp, strlen($this->reserved_));
         fwrite($fp, $this->reserved_);
     }
     if (!is_null($this->topic_)) {
         fwrite($fp, "");
         Protobuf::write_varint($fp, strlen($this->topic_));
         fwrite($fp, $this->topic_);
     }
     if (!is_null($this->source_)) {
         fwrite($fp, "\"");
         Protobuf::write_varint($fp, strlen($this->source_));
         fwrite($fp, $this->source_);
     }
 }