Code example for DataInput

Methods: readFully, readLong

0
  } 
 
  /** {@inheritDoc} */ 
  public void readFields(DataInput in) throws IOException {
    inputQuery = Text.readString(in);
    long paramCount = in.readLong();
    if (paramCount > 0) {
      VerticaRecord record = new VerticaRecord();
      record.readFields(in);
      segmentParams = record.getValues();
    } 
    start = in.readLong();
    end = in.readLong();
  } 
 
  /** {@inheritDoc} */ 
  public void write(DataOutput out) throws IOException {
    Text.writeString(out, inputQuery);
    if (segmentParams != null && segmentParams.size() > 0) {
      out.writeLong(segmentParams.size());
      VerticaRecord record = new VerticaRecord(segmentParams, true);
      record.write(out);
    } else 
      out.writeLong(0);
    out.writeLong(start);
    out.writeLong(end);
  } 
}