Quick and dirty, but it works. Java: public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream("lorem.txt"))); StringBuffer contentOfFile = new StringBuffer(); String line; while ((line = br.readLine()) != ...