Libraryless. Click here for Pure Java version (7966L/45K).
static File saveTextFileWithoutTemp(File file, S contents) ctex { mkdirsForFile(file); temp var fileOutputStream = newFileOutputStream(file); var outputStreamWriter = new OutputStreamWriter(fileOutputStream, "UTF-8"); var printWriter = new PrintWriter(outputStreamWriter); printWriter.print(unnull(contents)); printWriter.close(); ret file; }
Began life as a copy of #1001042
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1035310 |
| Snippet name: | saveTextFileWithoutTemp |
| Eternal ID of this version: | #1035310/4 |
| Text MD5: | 3369d3ef2a56ea018b07c62e2e980829 |
| Transpilation MD5: | 41de4f208d317d854ec8d17c51fb02c0 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-04-30 15:10:01 |
| Source code size: | 364 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 358 / 477 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |