JRuby: create Java InputStream or byte [] from RubyString

I have a Java method that I want to call from JRuby. The argument I want to pass is the usual string ( org.jruby.RubyString), but the Java method is overloaded to accept either:

  • java.io.InputStream
  • byte[]
  • com.google.protobuf.ByteString

In what simple way can I convert my string to an instance of one of these classes?

+3
source share
1 answer

Source: https://habr.com/ru/post/1768300/


All Articles