I am using a JavaScript to Applet object called JSObject and I get from my JSObject the value of a java object that I stored in my html page.
The java object is a byte[] but JavaScript converts it to a String.
So in the HTML page: object value = [B@ca0b6
In the Applet, the String value is also [B@ca0b6
Is there a way for me to convert this String value of [B@ca0b6 into the byte representation?
I don’t mean String.getByte() because that will convert the STRING [B@ca0b6 into byte[] data.
Thanks!
No, you can’t. This is the default
toString()method, which does not output anything of the array contents. It contains only the type of the object (array of bytes) and the memory address within the JVM, in hex.If you want to convert your array to
Stringproperly, useArrays.toString(array)