jruby.java.java_ext.java.io.rb Maven / Gradle / Ivy
require 'jruby' unless defined? JRuby
class java::io::InputStream
def to_io(opts = nil)
ruby_io = org.jruby.RubyIO.new(JRuby.runtime, self)
if opts && !opts[:autoclose]
ruby_io.setAutoclose(false)
end
JRuby.dereference(ruby_io)
end
end
class java::io::OutputStream
def to_io(opts = nil)
ruby_io = org.jruby.RubyIO.new(JRuby.runtime, self)
if opts && !opts[:autoclose]
ruby_io.setAutoclose(false)
end
JRuby.dereference(ruby_io)
end
end
module java::nio::channels::Channel
def to_io(opts = nil)
ruby_io = org.jruby.RubyIO.new(JRuby.runtime, self)
if opts && !opts[:autoclose]
ruby_io.setAutoclose(false)
end
JRuby.dereference(ruby_io)
end
end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy