×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Łukasz Zaręba
Added: Dec 31, 2015 2:33 PM
Views: 8
Tags: oneliner
  1. import static java.lang.System.out;
  2. import static java.nio.file.Files.readAllBytes;
  3. import static java.nio.file.Paths.get;
  4.  
  5. /**
  6.   * Java Class to read a file in one line
  7.   */
  8. public class FileIntoString {
  9.     public static void main(String[] args) throws Exception {
  10.         out.println(new String(readAllBytes(get("data_old.txt"))));
  11.     }
  12. }