org.jruby.util
Class IOInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.jruby.util.IOInputStream

public class IOInputStream
extends java.io.InputStream

This class wraps a IRubyObject in an InputStream. Depending on which messages the IRubyObject answers to, it will have different functionality. The point is that the IRubyObject could exhibit duck typing, in the style of IO versus StringIO, for example. At the moment, the only functionality supported is reading, and the only requirement on the io-object is that it responds to read() like IO.


Constructor Summary
IOInputStream(IRubyObject io)
          Creates a new InputStream with the object provided.
 
Method Summary
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOInputStream

public IOInputStream(IRubyObject io)
Creates a new InputStream with the object provided.

Parameters:
io - the ruby object
Method Detail

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2002-2007 JRuby Team. All Rights Reserved.