question: static private String readFromFile ( final File file ) throws IOException { final LineNumberReader r = new LineNumberReader ( new FileReader ( file ) ) ; try { final StringBuilder sb = new StringBuilder ( ) ; String s ; while ( ( s = r . readLine ( ) ) != null ) { if ( r . getLineNumber ( ) > 1 ) sb . append ( "\n" ) ; sb . append ( s ) ; } return sb . toString ( ) ; } finally { r . close ( ) ; } }
target:  Read the contents of a file. <p> Note: This makes default platform assumptions about the encoding of the file.