3

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

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

What's an easy way I can convert my string to an instance of one of those classes?

1 Answer 1

4

Found it: org.jruby.RubyString#to_java_bytes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.