Hmmm. I'm trying to write a class that accepts bytes, and would like to implement a well-known interface for this purpose.
java.io.OutputStream
is an abstract class, not an interface (why???) and that makes me nervous, as I don't know what the consequences are of extending it. If there are no consequences, it should have been an interface. Otherwise it makes me think that it defines equals()
and hashCode()
or maybe one of the Serializable
-related behaviors, and there's something I should know about before trying to extend it. Anyway if I do extend it, that means I've used up my 1 superclass and can't extend something else that's more vital to my application.
java.lang.Appendable
is an interface that does what I want, but for characters, not bytes.
java.nio.WritableByteChannel
is sort of what I want, and I might use it, but it only accepts ByteBuffers as inputs, not byte[] arrays.
Any other suggestions/advice? (p.s. is "input-output" the best tag for I/O questions?)