[SOLVED] Ussing ByteArray from lucee in java class

I’m trying to use java function which accept ByteArray as argument type. From lucee side I don’t know how to do this(
I’ve tried to use “some string”.getBytes() as argument but has error: “No matching Method/Function for JavaMethodName(binary) found”. Looks like my byte array converted to binary string.
Is there any way to use native byteArray?

Does ToBinary() and/or casting help?

myByteArray = ToBinary( "string" )
myJavaMethod( JavaCast( "byte[]", myByteArray ) )

No, javaCast doesn’t help.
That was my first idea.

This link help you?
Sorry, i dont know Java, it might be a useless suggestion.

1 Like

No, it’s manipulations with byteBuffer

Is that the only argument it accepts? Are there any public javadocs you could show us?

something along the lines of

2 Likes

Now I understand, my lib has its own class for working with ByteArray and I should use instance of this class :upside_down_face:.
Sorry, I’m already tiered at the end of day)

3 Likes

@Volodymyr_Vodnitskyi : I’ve tried to use “some string”.getBytes() as argument but has error: “No matching Method/Function for JavaMethodName(binary) found”. Looks like my byte array converted to binary string.
Is there any way to use native byteArray?

Might it be that something as simple as the following would have worked?

someString=“some string”;
someByteArray=someString.getBytes();
someResult=someJavaObject.javaMethodName(someByteArray);