[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Typed Arrays in W3C Specifications | Fwd: Updates to File API



On 5/14/10 4:07 PM, Chris Marrin wrote:
On May 14, 2010, at 3:01 PM, Vladimir Vukicevic wrote:

Blob isn't actually that (we can apparently blame Google Gears for that name :-) -- it's more like a generic Resource with an associated type, with a File being a specific kind of Resource/Blob that also has a filename, creation date, etc.
Well, the geek dictionary definition of Blob is "Binary Large Object", which equates to an unstructured sequence of bytes in my book. So maybe the File API is misusing the term :-)


But FileAPI isn't misusing the term, really :) Blob *could* be an unstructured sequence of bytes, per the geek dictionary definition of it as a Binary Large Object. However, per the File API, it has to be asynchronously "read" using FileReader, and can be read as:


1. A Binary String. This is an unfortunate kludge which dates to the era before ArrayBuffers. Using DOMStrings to manipulate binary data (with chars in the range 0..255) is NOT ideal.
2. Text, with encoding. Useful for some data types. This is the right use of String.
3. ArrayBuffers, thanks to this WG. So for implementations which don't have ArrayBuffers, we won't expose this method.


A File, which is a type of Blob with a name, a creationDate, and a modificationDate, can additionally be read as:

4. A DataURL.

Vlad pointed out in today's discussion that the term BlobReader (or DataReader) would have been better, since "FileReader" binds one to files, but naming things is hard on the web. We wanted a name that addressed the "majority use case" which is reading Files.

However, I *do* like Vlad's "DataChunk" proposal, but maybe an ArrayBuffer obviates having an "in-memory" synchronously accessible abstraction. XMLHttpRequest should have a responseBinary that exposes an ArrayBuffer.

Comments about File API should now be sent to public-webapps@w3.org, since I think the ArrayBuffer piece has been generally worked out. I'll update File API to reflect this. The point Chris made about the TR link not referring to the editor's draft is really well taken; I'll try and fix this.

Thanks to the WebGL WG for introducing better binary data metaphors to the web :-)

-- A*
-----------------------------------------------------------
You are currently subscribe to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: