public static <T extends Writable>T clone(T orig,Configuration conf){
  try {
    @SuppressWarnings("unchecked") T newInst=ReflectionUtils.newInstance((Class<T>)orig.getClass(),conf);
    ReflectionUtils.copy(conf,orig,newInst);
    return newInst;
  }
 catch (  IOException e) {
    throw new RuntimeException("Error writing/reading clone buffer",e);
  }
}

public static < T extends Writable > T clone ( T orig , Configuration conf ) { try { @ SuppressWarnings ( "unchecked" ) T newInst = ReflectionUtils . newInstance ( ( Class < T > ) orig . getClass ( ) , conf ) ; ReflectionUtils . copy ( conf , orig , newInst ) ; return newInst ; } catch ( IOException e ) { throw new RuntimeException ( "Error writing/reading clone buffer" , e ) ; } }
make a copy of a writable object using serialization to a buffer .
