RFR 4358774: Add null InputStream and OutputStream
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Sat Dec 9 01:06:49 UTC 2017
On 08/12/2017 16:49, Brian Burkhalter wrote:
> I agree it looks strange but it is intentional as it matches the
> existing InputStream.read(byte[],int,in) [1]. (I will remove line 167 as
> part of this patch.) Note that the IOE for the stream being closed would
> not be thrown in the current code until line 173.
Yes it is match the behavior, but both have a different specifications:
In the old methods there is a notion: "<p> If <code>len</code> is zero,
then no bytes are read and <code>0</code> is returned;" but in the new
method we have only one strong statement: "After the stream has been
closed, these methods all throw {@code IOException}."
--
Best regards, Sergey.
More information about the core-libs-dev
mailing list