Last active
November 9, 2019 12:53
-
-
Save seunggabi/d85e9f856315a6974a7e96d096e3b0bd to your computer and use it in GitHub Desktop.
makeFile.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static File makeFile(List<String> lines) throws IOException { | |
File temp = File.createTempFile(FILENAME, ""); | |
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(temp, true), StandardCharsets.UTF_8)); | |
for(String line : lines) { | |
bw.write(line + "\n"); | |
} | |
bw.close(); | |
return temp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment