示例#1
0
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
  */
 @Override
 public void readFrom(StreamInput in) throws IOException {
   int version = in.readVInt();
   id = in.readUTF();
   type = in.readUTF();
   source = in.readBytesReference();
   if (version >= 1) {
     if (in.readBoolean()) {
       routing = in.readUTF();
     }
   }
   if (version >= 2) {
     if (in.readBoolean()) {
       parent = in.readUTF();
     }
   }
   if (version >= 3) {
     this.version = in.readLong();
   }
   if (version >= 4) {
     this.timestamp = in.readLong();
   }
   if (version >= 5) {
     this.ttl = in.readLong();
   }
 }
示例#2
0
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
  */
 @Override
 public void readFrom(StreamInput in) throws IOException {
   int version = in.readVInt();
   uid = new Term(in.readUTF(), in.readUTF());
   if (version >= 1) {
     this.version = in.readLong();
   }
 }