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 the input I suppose that is your case. Also I suspect you have already the points prepared, at the server side in binary format. What I sould do is create a servlet that reads those files in the server side and return a JSON array of numbers. Then in javascript (client side) you call this servlet with ajax, perform eval() for obtaining the javascript array of values, and do the drawing using that javsacript array of numbers. Hope that helps.
On Wed, 23 May 2012 09:39:03 -0700 (PDT)
Carsten <carsten.schmied@googlemail.com> wrote:
> 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[] 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 byte[] in the client side?
> >
> > On Wed, 23 May 2012 08:30:25 -0700 (PDT)
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Carsten <carsten.schm...@googlemail.com> wrote:
> > > 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, Jim Douglas <jdou...@basis.com> wrote:
> > > > 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[] ?
> >
> > > > > 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 unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/google-web-toolkit?hl=en.
> >
> > --
> > Sebastian Gurin <sgu...@softpoint.org>
>
> --
> 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 unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
--
Sebastian Gurin <sgurin@softpoint.org>
--
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 unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment