4 ms·
Its not an interface though: public abstract class Reader Did Java add multiple inheritance or am I missing something?
by spion 4y ago
Its not an interface though:
public abstract class Reader
Did Java add multiple inheritance or am I missing something?
- Quekid5 4y agoThe interface you'd want to implement is probably https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/Readable.html https://docs.oracle.com/en/java/javase/20/docs/api/java.base... (and Appendable for the equivalent to Writer, probably AutoCloseable and Flushable as well.) However, there's lots of code which just takes a Reader/Writer and then you're SOL. (In general, the I/O interface/class hierarchy in Java is a bit of a mess because a lot of it was retrofitted to maintain binary compatibility. The equivalent stuff in Guava seems a bit saner, but of course not directly usable with all the 3rd party libraries you might want -- it has shims for the most part, though.)