question: public static String readFileAsString ( File file , String encoding ) throws IOException { ByteBuffer buffer = readFile ( file ) ; if ( null == encoding ) { encoding = "UTF-8" ; } String converted = new String ( buffer . array ( ) , encoding ) ; return converted ; }
target:  New NIO based method to read a file as a String with the given encoding.