[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] [Typed arrays] String to Buffer to String
On 2011/02/05 6:01, Dannii wrote:
> I work on VMs written in JS, which can run bytecode files of up to
> several MB. We currently use regular arrays but I'd like to shift to
> typed arrays soon. When the data is first downloaded we can get the
> buffer directly from the XHR, which is great. But because I'd like to
> be able to set it up to work offline as well, I want to store the
> files in localStorage, and read from it in the next session. As I
> understand it there's no way to do this other than just go through
> byte by byte. Which may be fine for desktop browsers, but will be
> quite slow for mobile browsers.
Can only Strings be stored in localStorage? Otherwise I can't think of a
reason why you need to convert the data.
> I was also wondering, what is the justification for requiring that a
> TypedArray's offset be a multiple of its element size? That makes it
> hard to emulate DataView (which won't be implemented in Firefox 4).
I don't recall the spec. allowing DataView to be an optional part of
typed arrays so I am very surprised to here that FF4 won't support them.
>From where did you get this information? (I can't check the spec. right
now because the link from the WebGL spec. is broken and I have been
unable to find it elsewhere in Khronos svn.)
org:HI Corporation;Middleware Development
adr:Higashiyama 1-4-4, Meguro-ku;;Meguro Higashiyama Bldg 5F;Tokyo;;153-0043;Japan
tel;work:+81 3 3710 9367
tel;fax:+81 3 5773 8660