Add a default method transferTo(java.lang.Appendable) to the java.lang.Readable interface. This method might be able to be specialized / optimized by sub-interfaces or implementing classes.
Comments
The existing method Reader::transferTo(Writer) seems to be a better solution for now.
02-10-2021
Would it be feasible to think about a static method on the Readable interface as mentioned on the second part of the comment:
Instead, Readable.transferTo() should probably be a static method, so that it does not give the illusion of being overridable.
13-12-2017
One could certainly propose this and see what the reaction is. I have no objection to it. This would of course be for JDK 11+ at this point.
13-12-2017
Do we want to keep this open or resolve as "Won't Fix?"
cf. http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-November/050064.html
13-12-2017
Patrick, henceforth the work you have posted under JDK-8067661 to core-libs-dev should be moved to this issue. Thanks!