public static String readFileToString ( File file , final Charset charset ) throws IOException { String line = null ; BufferedReader reader = getBufferReader ( file , charset ) ; StringBuffer strBuffer = new StringBuffer ( ) ; while ( ( line = reader . readLine ( ) ) != null ) { strBuffer . append ( line ) ; } return strBuffer . toString ( ) ; }
Read file to string string .