RubyString rubyString = (RubyString) rubyObject.callMethod(context, "to_s");
ByteList bytes = rubyString.getByteList();
try {
return new String(bytes.unsafeBytes(), bytes.begin(), bytes.length(), "UTF8");
} catch (UnsupportedEncodingException uee) {
return new String(bytes.unsafeBytes(), bytes.begin(), bytes.length());
}
} else if (javaClass == ByteList.class) {
return rubyObject.convertToString().getByteList();
} else if (javaClass == BigInteger.class) {
if (rubyObject instanceof RubyBignum) {