Maybe jsinterop.base library has some utility methods for cross casting.
Otherwise your options probably are (all untested):
1.) create a JavaScript file with a function that creates the array, then
use JsInterop to call that function.
2.) If you want it to be more generic and super unsafe you can probably
also write something like:
In utils.js:
window.apputils.reinterpret = function(o) {
return o;
}
In Java:
@JsMethod(namespace="apputils")
public static native <I, O> O reinterpret(I object);
byte[] bytes = reinterpret(new Int8Array(8));
This should allow you to reinterpret any java type without any cast
checking by GWT.
3.) If you don't want to create an external JavaScript file then you
probably have to try casting, e.g.
public byte[] createFastInt8(int size) {
return (byte[]) (Object) new Int8Array(size);
};
-- J.
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.