Code example for DataOutput

Methods: write

0
  } 
 
  /** 
   */ 
  public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, keyId);
    WritableUtils.writeVLong(out, expiryDate);
    if (key == null) {
      WritableUtils.writeVInt(out, -1);
    } else { 
      byte[] keyBytes = key.getEncoded();
      WritableUtils.writeVInt(out, keyBytes.length);
      out.write(keyBytes);
    } 
  } 
 
  /** 
   */ 
  public void readFields(DataInput in) throws IOException {
    keyId = WritableUtils.readVInt(in);
    expiryDate = WritableUtils.readVLong(in);