public void writeTo(DataOutput out) throws IOException {
  out.writeInt(schemaId);
  out.writeInt(ids.length);
  for (  Integer id : ids)   out.writeInt(id);
}

public void writeTo ( DataOutput out ) throws IOException { out . writeInt ( schemaId ) ; out . writeInt ( ids . length ) ; for ( Integer id : ids ) out . writeInt ( id ) ; }
the object implements the writeto method to save its contents by calling the methods of dataoutput for its primitive values and strings or calling the writeto method for other objects .
