org.jruby.util
Class IOOutputStream
java.lang.Object
java.io.OutputStream
org.jruby.util.IOOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public class IOOutputStream
- extends java.io.OutputStream
This class wraps a IRubyObject in an OutputStream. 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 writing, and the only requirement on the io-object is
that it responds to write() and close() like IO.
- Author:
- Ola Bini
Method Summary |
void |
close()
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int bite)
|
Methods inherited from class java.io.OutputStream |
flush |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IOOutputStream
public IOOutputStream(IRubyObject io)
- Creates a new OutputStream with the object provided.
- Parameters:
io
- the ruby object
write
public void write(int bite)
throws java.io.IOException
- Specified by:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.OutputStream
- Throws:
java.io.IOException
Copyright © 2002-2007 JRuby Team. All Rights Reserved.