@JRubyMethod(name = "ready?")
public static IRubyObject ready(ThreadContext context, IRubyObject obj) {
RubyIO io = (RubyIO)obj;
try {
OpenFile openFile = io.getOpenFile();
ChannelDescriptor descriptor = openFile.getMainStreamSafe().getDescriptor();
if (!descriptor.isOpen() || !openFile.getMainStreamSafe().getModes().isReadable() || openFile.getMainStreamSafe().feof()) {
return context.runtime.getFalse();
}
int avail = openFile.getMainStreamSafe().ready();
if (avail > 0) {