groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Kunz <Michael.K...@kuebrich.com>
Subject Unexpected byte[] parameter conversion when calling java method
Date Fri, 20 Oct 2017 07:51:01 GMT
Hello,

I'm having problems calling a Java method call(byte[]... data) from
groovy 2.4.12.
I'm trying to call it with a single byte[] value from groovy like this:
byte[] data = [0,1,2,3,4,5,6,7]
TestJava.call(data)

I was expecting to receive a byte[][] data = {{0,1,2,3,4,5,6,7}} in Java
but instead have a split array of the form byte[][] data =
{{0},{1},{2},{3},{4},{5},{6},{7}} which doesn't make sense to me.
A full example is available at
https://gist.github.com/protogenes/93a5d76075b45ba5a946034820f03c76

What is the expected behaviour and why? Can I change the Java method
signature in a way so that the arrays are preserved?

Regards, Michael

Mime
View raw message