[Public WebGL] [Typed arrays] String to Buffer to String

Mark Callow [email protected]
Mon Feb 7 12:41:17 PST 2011


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.)

Regards

    -Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: callow_mark.vcf
Type: text/x-vcard
Size: 378 bytes
Desc: not available
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20110207/d2256c27/attachment.vcf>


More information about the public_webgl mailing list