public abstract class IOChannel
extends java.lang.Object
implements java.nio.channels.Channel
| Modifier and Type | Class and Description |
|---|---|
static class |
IOChannel.IOReadableByteChannel
A
ReadableByteChannel wrapper around an IO-like Ruby object. |
static class |
IOChannel.IOReadableWritableByteChannel
A
ReadableByteChannel and WritableByteChannel wrapper around an IO-like Ruby object. |
static class |
IOChannel.IOWritableByteChannel
A
WritableByteChannel wrapper around an IO-like Ruby object. |
| Modifier and Type | Field and Description |
|---|---|
protected IRubyObject |
io |
protected Ruby |
runtime |
| Modifier | Constructor and Description |
|---|---|
protected |
IOChannel(IRubyObject io) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected CallSite |
initReadSite(java.lang.String readMethod) |
protected CallSite |
initWriteSite() |
boolean |
isOpen() |
protected static int |
read(Ruby runtime,
IRubyObject io,
CallSite read,
java.nio.ByteBuffer dst) |
protected static int |
write(Ruby runtime,
IRubyObject io,
CallSite write,
java.nio.ByteBuffer src)
Perform a write to the given IO-like object, using the given call site, and passing the contents of the given
buffer.
|
protected final IRubyObject io
protected final Ruby runtime
protected IOChannel(IRubyObject io)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channeljava.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelprotected static int read(Ruby runtime, IRubyObject io, CallSite read, java.nio.ByteBuffer dst)
protected static int write(Ruby runtime, IRubyObject io, CallSite write, java.nio.ByteBuffer src)
runtime - the current runtimeio - the target IO-like objectwrite - the call site for making dynamic `write` callssrc - the data to writeprotected CallSite initReadSite(java.lang.String readMethod)
protected CallSite initWriteSite()
Copyright © 2001-2021 JRuby. All Rights Reserved.