Java_send with Java Array Parameter Type?

All -

I’m trying to use java_send to call a Java class constructor that takes
a
byte array as its sole parameter. How do I specify the byte array?

My best guess is:

Message.java_send(:new, [Java::Lbyte], byte_data)

…but I get this error:

 TypeError:
   cannot convert instance of class org.jruby.RubyModule to class

java.lang.Class

Thanks,
Keith

I found out that I could get the Java class of a byte array with:

java.lang.Class.forName(’[B’)

  • Keith

On May 8, 2013, at 6:34 PM, Keith B. wrote:

I found out that I could get the Java class of a byte array with:

java.lang.Class.forName(‘[B’)

System.out.println(byte[].class);
class [B

gets you there too. Theres the TYPE field for some primitive types but
I’m not remembering exactly how that works and if it applies to arrays.

Michael H.

trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz

HalfPipe Java 6/7 shell app
http://www195.pair.com/mik3hall/index.html#halfpipe

AppConverter convert Apple jvm to openjdk apps
http://www195.pair.com/mik3hall/index.html#appconverter