Code example for DataInput

Methods: readFullyreadIntreadLongreadUTF

0
  private byte [] column;
  private byte [] value;
 
  @Override 
  public void readFields(DataInput din) throws IOException {
    columnFamily = din.readUTF();
    timeStamp = din.readLong();
    int clength= din.readInt();
    column = new byte[clength];
    din.readFully(column, 0, clength);
    int vlength = din.readInt();
    value = new byte [vlength ];
    din.readFully( value, 0 , vlength);
  } 
 
  @Override 
  public void write(DataOutput out) throws IOException {
    out.writeUTF(columnFamily);
    out.writeLong(timeStamp);
    out.writeInt( column.length );
Connect your IDE to all the code out there  Get Codota for Java