cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: BufferedOutputStream
Date Mon, 02 Jun 2008 12:30:44 GMT
On 02.06.2008 05:56, Sylvain Wallez wrote:

>>> Only issue I want to solve before the release is the 
>>> BufferedOutputStream issue. I planned to do it this weekend.
>>
>> Done. Please review the file attached. It's still completely untested. 
>> At the moment I need some sleep ;) I will write junit tests for it 
>> this week and eventually commit it.
> 
> Stupid question: why do we need a special BufferedOutputStream?

For being able to reset the response buffer for error handling. This is 
also possible with java.io.BufferedOutputStream, if the buffer size is 
big enough (current default value is 1MB), but then the buffer byte[] is 
always that big rather than increasing. That's what's happening right 
now, if you don't specify -1 as buffer size. -1 means complete buffering 
which on the other hand might lead to OutOfMemoryError [1]. In addition 
our BOS counts the bytes so that we can use the value to set the content 
length header.

Joerg

[1] https://issues.apache.org/jira/browse/COCOON-2168

Mime
View raw message