On Tue, Oct 25, 2011 at 1:56 PM, Haase, Konstantin
<Konstantin.Haase / student.hpi.uni-potsdam.de> wrote:
> Maybe another idea would be to introduce a Streamable protocol/class/module, and add a to_stream method both to IO and StringIO. It could also ease implementing your own IO-like behavior.

This is not without precedent: JRuby's IO has to_ methods to aid Java
integration: to_inputstream, to_outputstream, and to_channel. And
Java's InputStream, OutputStream, and Channel classes are decorated
with to_io.

- Charlie