RFR 4358774: Add null InputStream and OutputStream

Pavel Rappo pavel.rappo at oracle.com
Thu Dec 7 17:38:44 UTC 2017


> On Dec 6, 2017, at 11:11 AM, Jonathan Gibbons <jonathan.gibbons at oracle.com> wrote:
> 
>> "null" is a significant term in the Java ecosystem, and the relationship here, to /dev/null or NUL seems somewhat tenuous.
>> 
>> Have any other names been considered?  At least for the InputStream, calling it an "empty stream" seems more intuitive than a "null stream".

Jon, I think there's an established name for this kind of objects: 

    https://en.wikipedia.org/wiki/Null_object_pattern

> On 6 Dec 2017, at 22:28, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> 
> The name “emptyStream()” was considered for InputStream and “discardingStream()” for OutputStream. It was thought that “null” or “empty” would be more likely to be found by developers due to familiarity. FWIW there is precedent in third party libraries for the “null” names.
> 
> Brian

+1



More information about the core-libs-dev mailing list