Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<String> readFile(String file){
- try {
- Path path = Paths.get(file);
- return Files.readAllLines(path,
- StandardCharsets.UTF_8);
- } catch (IOException e) {
- // io exception reading from file...
- }
- return null;
- }
- public void writeToFile(String file, List<String> lines){
- try {
- Path path = Paths.get(file);
- Files.write(path, lines);
- } catch (IOException e) {
- // io exception writing to file...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment