Package org.jruby.util
Class IOInputStream
java.lang.Object
java.io.InputStream
org.jruby.util.IOInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CallSiteprivate final InputStreamprivate final IRubyObjectprivate final IRubyObjectprivate final CallSiteprivate final Ruby -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new InputStream with the object provided.IOInputStream(IRubyObject io, boolean verifyCanRead) -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
runtime
-
io
-
in
-
numOne
-
readAdapter
-
closeAdapter
-
-
Constructor Details
-
IOInputStream
Creates a new InputStream with the object provided.- Parameters:
io- the ruby object
-
IOInputStream
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-