Re: Updates to File API

On 5/13/10 7:37 AM, David Levin wrote:
> On Thu, May 13, 2010 at 5:27 AM, Arun Ranganathan<arun@mozilla.com>  wrote:
>
>    
>> Greetings WebApps WG,
>>
>> I have updated the editor's draft of the File API to reflect changes that
>> have been in discussion.
>>
>> http://dev.w3.org/2006/webapi/FileAPI
>>
>> Notably:
>>
>> 1. Blobs now allow further binary data operations by exposing an
>> ArrayBuffer property that represents the Blob.
>>      
>
> Does this imply *sync* access to the blob data? "new
> DataArray(blob.blobBuffer).getInt8(0);"
>    

A more sensible way is an additional asynchronous read method on 
FileReader, which is what I should have done in the first place.  Here, 
partial data is going to be an interesting question.  While partial 
strings makes sense (for readAsBinaryString and readAsText), partial 
ArrayBuffers gets us into a different area altogether.  Any thoughts on 
partial reads here?

For now, I've caveated my (pretty major) mistake with an editor's note.  
I'll update later today with a better way to expose this, but I'm 
thinking something like readAsArrayBuffer on FileReader (with an open 
question on partial reads).
> Also, does it imply the ability to modify the blob contents? (If so, what
> does this mean when there is a file backing it?)
> "new DataArray(blob.blobBuffer).setInt8(0, 0);"
>    

I'll let Eric speak to what BlobBuilder might want to do, but I'll 
strongly disallow it in my draft :)

-- A*
> Thanks, dave
>
>    

Received on Thursday, 13 May 2010 15:22:24 UTC