RFR 4358774: Add null InputStream and OutputStream

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Sat Dec 9 00:34:11 UTC 2017


Hi, Brian.
On 08/12/2017 15:12, Brian Burkhalter wrote:
> All previous suggested changes have been made in
> 
> http://cr.openjdk.java.net/~bpb/4358774/webrev.03/

One more issue that according to the spec the new method
read(byte[], int, int) should throw an exception if the stream was 
closed, but as far as I understand it can return "0" if "len=0" even if 
the stream was closed before:
   99             @Override
  100             public int read(byte[] b, int off, int len)
  101                 Objects.checkFromIndexSize(off, len, b.length);
  102                 if (len == 0) {
  103                     return 0;
  104                 }
  105                 ensureOpen();
  106                 return -1;
  107             }


-- 
Best regards, Sergey.


More information about the core-libs-dev mailing list