コード例 #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();
      source = in.readBytesReference();
      if (version < 2) {

        if (in.readBoolean()) {
          in.readUTF();
        }
      }
      int typesSize = in.readVInt();
      if (typesSize > 0) {
        types = new String[typesSize];
        for (int i = 0; i < typesSize; i++) {
          types[i] = in.readUTF();
        }
      }
      if (version >= 1) {
        int aliasesSize = in.readVInt();
        if (aliasesSize > 0) {
          filteringAliases = new String[aliasesSize];
          for (int i = 0; i < aliasesSize; i++) {
            filteringAliases[i] = in.readUTF();
          }
        }
      }
    }
コード例 #3
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 {
   acknowledged = in.readBoolean();
 }