Maybe you can use this for inspiration... https://gist.github.com/ibaca/d8c14e19bf8f96bbe1b4b7f1291b6b24#file-dtachoviewer-java-L99 we used this to read binary files and decode in the client side. We transform the field in a byte[], after that converting to strings (new String(b, "ISO-8859-1")) or ints are trivial. You can do something as simple as int x = byte[0]; or are more advanced like.
On Sunday, May 29, 2016 at 7:15:21 PM UTC+2, Jens wrote:
-- public static long convertIntoUnsigned4ByteInt(byte[] b) {All this just work. I have a file drag&drop example here https://github.com/ibaca/dndfiles-gwt. Not sure if useful, but is the original point of the other example (gist). Transforming it to a byte[] is not very performant (byte are emulated in gwt), but is easier and our library already exists and use byte[] everywhere.
long l = 0;
long al = ( ( (long)b[ 0 ] ) & 0xff ) << 24 ;
long bl = ( ( (long)b[ 1 ] ) & 0xff ) << 16 ;
long cl = ( ( (long)b[ 2 ] ) & 0xff ) << 8 ;
int di = ( b[ 3 ] & 0xff );
long dl = ( (long)di ) << 0;
l = al + bl + cl + dl;
return l;
}
On Sunday, May 29, 2016 at 7:15:21 PM UTC+2, Jens wrote:
Never done it but I would say so. GWT supports new String(byte[]) with UTF-8, LATIN-1, ISO_8859_1 charsets. For numbers you probably have to use BigInteger or do the conversion yourself as GWT does not emulate ByteBuffer.wrap(..).get...() for now.-- 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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment