[PATH] bug 4254082 & 4479751 draft
The patch seems to solve both bugs while doing the right thing. It hasn't been tested well though and the last thing I want is new bugs. Does anybody have or know a application which utilises the BufferedInputReader with marks? If it works I'll finish it. The read(byte[]) method doesn't work correct anymore now that read(byte[],int,int) has been fixed.
On Sunday 08 July 2007 14:00:18 Pascal S. de Kloe wrote:
The patch seems to solve both bugs while doing the right thing.
It hasn't been tested well though and the last thing I want is new bugs. Does anybody have or know a application which utilises the BufferedInputReader with marks?
If it works I'll finish it. The read(byte[]) method doesn't work correct anymore now that read(byte[],int,int) has been fixed.
Fixed a little mistake. Fixes 6192696 now too.
Please hold off on this. This patch doesn't solve the fundamental problem I've raised, and submitting a patch before we've finished discussing the desired behavior is premature. Bill P.S. One problem with the patch is that skip can still return a short skip in situations other than being at end of file. On Jul 8, 2007, at 5:59 AM, Pascal S. de Kloe wrote:
On Sunday 08 July 2007 14:00:18 Pascal S. de Kloe wrote:
The patch seems to solve both bugs while doing the right thing.
It hasn't been tested well though and the last thing I want is new bugs. Does anybody have or know a application which utilises the BufferedInputReader with marks?
If it works I'll finish it. The read(byte[]) method doesn't work correct anymore now that read(byte[],int,int) has been fixed.
Fixed a little mistake. Fixes 6192696 now too.<BufferedInputStream.patch>
On Sunday 08 July 2007 16:19:57 you wrote:
Please hold off on this. This patch doesn't solve the fundamental problem I've raised, and submitting a patch before we've finished discussing the desired behavior is premature.
I wanted to discuss it with you but you didn't respond anymore.
P.S. One problem with the patch is that skip can still return a short skip in situations other than being at end of file.
That is up to the implementation of the protected InputStream #in but the BufferedInputStream does all it can, right? A final patch is coming within an hour and then I'll shut up, OK?
More fixes and implements read(byte[]) too. As promissed, I'll stop flooding this mailinglist for a while and see what happens...
The patch is supposed to fix at least the following bugs. bug 4254082: Marked as "Closed, will not be fixed" for no good reason. The new skip(long) implementation discards as much as possible from the buffer and requests in.skip(long) to do the rest if necessary. The test case works correct now. bug 4401235: Marked as "Closed, not a bug" for no good reason. The updated read(byte[], int, int) does no longer block as it is documented not to do so. The test case works correct now. bug 4479751 & 6192696: Falsely marked as "Closed, fixed" and so are their "Related Bugs". The updated fill() uses available(). The test case works correct now. bug 6557791: With 6192696 fixed, read(byte[]) had to be implemented to make sure it works as described in InputStream.read(byte[]). The new implementation also fixes this bug. The test case works correct now. I think the patch is ready. Any success/failure reports or comments/critics are more than welcome. Cheers, Pascal
The attachment contains the latest patch with two (embarrassing stupid) fixes. The good news is that the few testers did have good results including little performance gains. The bad news is that many (all?) streams do not include EOF in the available() so that read(byte[], int, int) keeps returning 0. Any opinions on that?
participants (2)
-
Bill Pugh
-
Pascal S. de Kloe