title: How to pass Java InputStream to JRuby io that supports pos/seek
body: <p>I need to call a (j)ruby script from java runtime, and I want to pass an input stream as a parameter.</p>
  
  <p>On the ruby side, I'm using to_io to convert input stream</p>
  
  <pre><code>io = my_stream.to_io
  </code></pre>
  
  <p>I'm getting these errors:</p>
  
  <pre><code>org.jruby.exceptions.RaiseException: (Errno::ESPIPE) Illegal seek
  at org.jruby.RubyIO.pos(org/jruby/RubyIO.java:1602) ~[jruby-core-1.7.4.jar:na]
  </code></pre>
  
  <p>The question is, are there better options to convert input stream to io that support pos and seek?</p>