Name: gm110360 Date: 06/16/2004
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
The javadoc of java.io.SequenceInputStream
in the method read(byte[], int, int) is :
// JAVADOC
public int read(byte[] b,
int off,
int len)
throws IOException
Reads up to len bytes of data from this input stream into an array of bytes. This method blocks until at least 1 byte of input is available. If the first argument is null, up to len bytes are read and discarded.
The read method of SequenceInputStream tries to read the data from the current substream. If it fails to read any characters because the substream has reached the end of the stream, it calls the close method of the current substream and begins reading from the next substream.
// ENDJAVADOC
There is one line which is false :
"If the first argument is null, up to len bytes are read and discarded."
It is false and it must be changed because if b is null an NPE is thrown
--------
Is it possible to give a List constructor
and for Tiger to give an args... constructor for multiple inputstream
--------
I ask at the same time to something logical to have
java.io.SequenceReader (which will work the same but for Reader)
I've done one for myself by taking the source of SequenceInputStream
REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 277170)
======================================================================
- duplicates
-
JDK-6244191 (spec) SequenceInputStream.read(...) - some spec is not implemented.
-
- Resolved
-