//jdk BufferedWriter close()源码
public void close() throws IOException {
synchronized (lock) {
if (out == null) {
return;
}
try {
flushBuffer();//close方法包含flush,所以close之前没必要flush啦。
} finally {
out.close();//调用write对象的close方法。
out = null;
cb = null;
}
}
} |
|