Message78606
| Author |
severb |
| Recipients |
amaury.forgeotdarc, christian.heimes, pitrou, severb |
| Date |
2008年12月31日.13:49:03 |
| SpamBayes Score |
1.9489377e-10 |
| Marked as misclassified |
No |
| Message-id |
<1230731344.27.0.696957951453.issue4263@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
>> The comment is misleading because in fact no byte is written at raw
>> level. That's because the data size is smaller than the buffer size and
>> the buffer is empty (was emptied by the last write call).
> It depends on the implementation. A different implementation may use a
> different algorithm.
I feel that no matter what implementation algorithm BufferedWriter uses
it shouldn't write smaller chunks of data than buffer's size or else the
buffer is useless.
>> I also think this is the
>> correct behavior regardless of implementation language of BufferedWriter
>> class i.e. no write call should write at raw level smaller chunks of
>> data than buffer's size unless it has to.
> But how do you decide when it "has to"? Unless you want to constrain the
> exact implemented algorithm, you can't do that in your tests.
When a direct or indirect (e.g. on close) flush is called for the file
object. |
|