Blank file after writing to it?

前端 未结 3 1449
旧巷少年郎
旧巷少年郎 2021-01-18 02:54

So I have been trying to write a Bukkit plugin for a friend of mine, and for some reason the config generation is not working. The code in question is below, and I will be h

3条回答
  •  隐瞒了意图╮
    2021-01-18 03:22

    You need to call...

    out.flush();
    

    ... right before you call...

    out.close();
    

    PrintWriter uses buffer in memory to make more efficient use of the disk. You need to call flush() to tell the PrintWriter to write your data.

提交回复
热议问题