W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

From: Glenn Maynard <glenn@zewt.org>
Date: Sat, 28 Apr 2012 09:54:34 -0500
Message-ID: <CABirCh8vEoBD49zko=bH5Exyq3Enewg5vkvi2O--aKv_oH5XtQ@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Arun Ranganathan <aranganathan@mozilla.com>, Anne van Kesteren <annevk@opera.com>, David Herman <dherman@mozilla.com>, Eric U <ericu@google.com>, Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org
On Sat, Apr 28, 2012 at 3:45 AM, Jonas Sicking <jonas@sicking.cc> wrote:

> We should not have readAsArryBufferView since there's a ton of
> different types of ArrayBufferViews. Instead we should just return an
> ArrayBuffer and let people construct ArrayBufferViews or DataViews
> into that as they see fit.
>

It would have made sense to return an Int8Array in all cases instead of an
ArrayBuffer: it's probably by far the most common actual data type,
treating buffers as char* by default isn't unusual, and it allows passing
the results of one API directly into another API.  Having API inputs and
outputs use two different types is pretty asymmetric.

(I say that in past tense; it's probably too late to fix this.  Also, I'd
rather live with that asymmetry than have every single ArrayBuffer entry
point have separate ArrayBuffer and ArrayBufferView overloads.)

-- 
Glenn Maynard
Received on Saturday, 28 April 2012 14:55:03 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:52 GMT