Re: Read in binary file into byte[] ?

2012-05-23 Thread Carsten
I think I should have been more clear. I don't want to load a file from the users computer. I want to read a file from the directory on the server where my GWT app lives. I just want to know the options I have to read this binary file into a byte[]. I am very new with GWT :) On May 23, 4:53 am,

Re: Read in binary file into byte[] ?

2012-05-23 Thread Sebastian Gurin
in general you don't use byte[] or the bynary content of a file directly in the client side, unless you are making something *really special* like implementing image filters using html canvas or somthing like that. What are you trying to do or better, why do you have to read a file into a

Re: Read in binary file into byte[] ?

2012-05-23 Thread Carsten
Well, it is a binary file with point/spline-data. I need to construct eventually Path objects out of this data and draw it on a canvas. A byte[] would be the perfect data structure to hold this data. On May 23, 3:26 pm, Sebastian Gurin sgu...@softpoint.org wrote: in general you don't use byte[]

Re: Read in binary file into byte[] ?

2012-05-23 Thread Jim Douglas
If the goal is to read a file and perform computations on the data, then that process belongs on the server, where it can be done in Java, and on a machine that has significantly more horsepower. Process the data as much as makes sense for your application, then ship the processed data over to

Re: Read in binary file into byte[] ?

2012-05-23 Thread Sebastian Gurin
so I guess it is an array of points and you wish to represent them as byte[]. In the client side, I think byte[], int[] or double[] are the same internally, since javascript only support a single Number type. Most charting / graphics libraries will accept a native javascript array of numbers as

Re: Read in binary file into byte[] ?

2012-05-23 Thread Joseph Lust
See the Google IO games lecture @ 33:50, they discuss this issue in GWT with binary data transfers: http://www.youtube.com/watch?v=NNmoEOpGJdk Sincerely, Joseph -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on

Re: Read in binary file into byte[] ?

2012-05-23 Thread Sebastian Gurin
they mention passing the binary data using utf strings. I wonder if in the server side we can use TextResource.getText().getBytes(UTF-8) safely for that. Also it uses JavaScript typed arrays (new FLoat32Array) for accssing the array in javascript but I wonder if that is really neccesary.

Read in binary file into byte[] ?

2012-05-22 Thread Carsten
Hi, is it possible to read in a binary file in my GWT Java-code and convert it into a byte[] ? Thanks! Carsten -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To

Re: Read in binary file into byte[] ?

2012-05-22 Thread Jim Douglas
Not in GWT proper, and not reliably in all browsers. Start your reading here: http://www.google.com/search?q=javascript+file+api On May 22, 12:42 pm, Carsten carsten.schm...@googlemail.com wrote: Hi, is it possible to read in a binary file in my GWT Java-code and convert it into a byte[] ?