Created
February 5, 2015 21:37
-
-
Save mickeypash/02d3572cb0c0a92cb8a6 to your computer and use it in GitHub Desktop.
Buffered writer in 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
void writeFileBytesBuffered(String filename, String content) { | |
try { | |
BufferedWriter writer = | |
Files.newBufferedWriter( | |
FileSystems.getDefault().getPath(".", filename), | |
Charset.forName("US-ASCII"), | |
StandardOpenOption.CREATE); | |
writer.write(content, 0, content.length()); | |
} | |
catch ( IOException ioe ) { | |
ioe.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment