以下代码给了我这个错误:
java.lang.NullPointerException java.io.FileOutputStream.(Unknown Source) java.io.FileOutputStream.(Unknown Source) java.io.FileWriter.(Unknown Source)
SAXBuilder parser = new SAXBuilder();
this.document = parser.build(path);
//changes on the doc happening here
FileWriter writer = new FileWriter(path);
XMLOutputter out = new XMLOutputter();
out.output(this.document, writer);
writer.flush();
writer.close();
怎么来的?文件被锁定还是什么?
旁注:使用 BufferedOutputStream 类有什么好处?