Java Snippet – Read Entire File (Including EOL Characters!) Not Line-By-Line And Without Loops!

This nice technique reads the file `as is`,
it even keeps the internal EOL characters (`\r\n`, `\n`,..)

It requires no external-libraries and even compatible with Java7!

Forget the entire awkward combination of InputStream, FileInputStream, FileReader, InputStreamReader and BufferedReader
and those embarrassing readline() loops!

Continue reading