public void readFrom(DataInput in) throws IOException {
  schemaId=in.readInt();
  int idsCnt=in.readInt();
  List<Integer> fieldIds=new ArrayList<>(idsCnt);
  for (int i=0; i < idsCnt; i++)   fieldIds.add(in.readInt());
  initialize(fieldIds);
}

public void readFrom ( DataInput in ) throws IOException { schemaId = in . readInt ( ) ; int idsCnt = in . readInt ( ) ; List < Integer > fieldIds = new ArrayList < > ( idsCnt ) ; for ( int i = 0 ; i < idsCnt ; i ++ ) fieldIds . add ( in . readInt ( ) ) ; initialize ( fieldIds ) ; }
the object implements the readfrom method to restore its contents by calling the methods of datainput for primitive types and strings or calling readfrom for other objects . the readfrom method must read the values in the same sequence and with the same types as were written by writeto .
