java – FileWriter vs BufferedWriter

I wonder if filewriter is buffered

In this so problem, it seems to be, but in this so problem, it doesn't seem to be This will be the system call called every time a write (...) occurs

So basically, I'm a little confused about reading those two Q & as Can anyone explain it clearly?

Thank you in advance

Editor: the problem was solved by reading this API. I quoted the relevant parts:

Because filewriter extends outputstreamwriter, it also applies to it

Thank you for your time. I know I asked some very specific things

Solution

Filewriter has no buffer. You must use bufferedwriter as wrapper:

final int myBufferSize = 2048;

Writer myWriter = new BufferedWriter(new FileWriter,myBufferSize);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>