public static void convert ( RecordReader reader , RecordWriter writer , boolean closeOnCompletion ) throws IOException { if ( ! reader . hasNext ( ) ) { throw new UnsupportedOperationException ( "Cannot convert RecordReader: reader has no next element" ) ; } while ( reader . hasNext ( ) ) { writer . write ( reader . next ( ) ) ; } if ( closeOnCompletion ) { writer . close ( ) ; } }
Write all values from the specified record reader to the specified record writer . Optionally close the record writer on completion