InputStream and OutputStream equivalents to /dev/null are very useful for testing. We should consider adding factory methods for these.
A discussion point is whether they can be singletons, probably not as it may be useful for testing to have read/write throw exceptions when the stream is closed.
A discussion point is whether they can be singletons, probably not as it may be useful for testing to have read/write throw exceptions when the stream is closed.
- duplicates
-
JDK-4358774 Add null InputStream and OutputStream
-
- Resolved
-