-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.0.2
-
sparc
-
solaris_2.5
This bug was found by St.Petersburg Java SQE team (by Stanislav Avzan).
The java.io.SequenceInputStream specs don't describe behaviour of read
methods explicitly.
The Java Language specification (Version 1.0 - August 1, 1996) says only:
"22.8.3 public int read() throws IOException
Implements the read method of InputStream (p.22.3.1).
22.8.4 public int read(byte[] buf, int pos, int len)
throws IOException, NullPointerException,
IndexOutOfBoundsException
Overrides the read method of InputStream (p.22.3.3)."
It's evident, of course, that read() takes one byte after another from
streams in sequence. But as to read(buf,pos,len) method, I suppose
that a statement similar to that below should be explicitly specified:
If number of bytes remained in the current stream in sequence is
greater than 0 and less than the number of bytes requested then only
the bytes remained are read (the next stream in sequence is not touched).
If 0 bytes remained then next stream in sequence is requested.
The java.io.SequenceInputStream specs don't describe behaviour of read
methods explicitly.
The Java Language specification (Version 1.0 - August 1, 1996) says only:
"22.8.3 public int read() throws IOException
Implements the read method of InputStream (p.22.3.1).
22.8.4 public int read(byte[] buf, int pos, int len)
throws IOException, NullPointerException,
IndexOutOfBoundsException
Overrides the read method of InputStream (p.22.3.3)."
It's evident, of course, that read() takes one byte after another from
streams in sequence. But as to read(buf,pos,len) method, I suppose
that a statement similar to that below should be explicitly specified:
If number of bytes remained in the current stream in sequence is
greater than 0 and less than the number of bytes requested then only
the bytes remained are read (the next stream in sequence is not touched).
If 0 bytes remained then next stream in sequence is requested.