What is the most efficient/elegant way to dump a StringBuilder to a text file?
You can do:
outputStream.write(stringBuilder.toString().getBytes());
Since java 8 you only need to do this:
Files.write(Paths.get("/path/to/file/file_name.extension"), stringBuilder.toString().getBytes());
You don't need any third party libraries to do that.