我有一个FileOutputStream
像这样的cicle:
PrintStream output = new PrintStream(new FileOutputStream("XXXX.json"));
output.print("{\"ObjectsList\": [");
for (int i = 0; i < something.length; i++) {
output.print("{"AAAA"},");
}
output.print("]}")
但我不需要char ","
在那之前output.print("]}");
如何在 EOF-1 或 EOF-2 写入以覆盖最后一个字符","