leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
459 stars 21 forks source link

No method to convert return value Uint16Array to js object? #157

Closed liangklfangl closed 1 year ago

liangklfangl commented 1 year ago

Invoke a java method which return value like bellow:

{ "value0": { "0": 67, "1": 35, "2": 69, "3": 54, "4": 52, "5": 49, "6": 52, "7": 69, "8": 44, "9": 35, "10": 70, "11": 70, "12": 55, "13": 51, "14": 55, "15": 51, "16": 44, "17": 84, "18": 76, "19": 95, "20": 66, "21": 82 }, "hash1": 0 }

I am confused about how to convert this return value to js object?

alexp-sssup commented 1 year ago

That is a Java string, you can use the cjStringJavaToJs API (documented here https://docs.leaningtech.com/cheerpj/Runtime-API#cjstringjavatojsstr--cjstringjstojavastr) to obtain a JS version.