RFR 4358774: Add null InputStream and OutputStream

Brian Burkhalter brian.burkhalter at oracle.com
Wed Dec 6 20:05:56 UTC 2017


On Dec 6, 2017, at 11:54 AM, Jason Mehrens <jason_mehrens at hotmail.com> wrote:

> For nullInputStream would it make any sense to use the ByteArrayInputStream with a (private static) empty byte array?  Maybe 'return new ByteArrayInputStream("".getBytes());'?  One side effect is that mark support returns true.

As we are trying to retain the behavior of closed streams throwing IOExceptions I don’t think that BAIS would work here.

> Does it make sense to follow the advice inhttps://bugs.openjdk.java.net/browse/JDK-6533165 with regards to streams being closed?

I don’t know exactly what you intend here. In the linked issue there is information to impart, namely the index and the size. Here there is only the indication that the stream is closed. It’s not clear to me what could be done here.



More information about the core-libs-dev mailing list