I'm writing classes work like FilterInputStream or FilterOutputStream.
Looks like
public FilterReadableByteChannel implements ReadableByteChannel {
// Should I permit null for channel?
public FilterReadableByteChannel(final ReadableByteChannel channel) {
// ...
}
}
And I found that both FilterInputStream and FilterOutputStream permit null
source.
* @param in the underlying input stream, or <code>null</code> if
* this instance is to be created without an underlying stream.
Question:
- Is there any practical reason for this?
- Is there any possible case that changing the underlying source after created?
I know that Why Not?
could be an answer, but I want to know if there were any reason why the original API designer did this.