Skip to content

Instantly share code, notes, and snippets.

@calebmeyer
Last active August 29, 2015 14:07
Show Gist options
  • Save calebmeyer/7d0906045ab882be4b2c to your computer and use it in GitHub Desktop.
Save calebmeyer/7d0906045ab882be4b2c to your computer and use it in GitHub Desktop.
Java read a file. In one line.
String fileContent = new Scanner(new File("path/to/file.txt")).useDelimiter("\\A").next();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment