W3C home > Mailing lists > Public > public-webapi@w3.org > July 2007

Re: [XHR2] responseBody (byte array)

From: Maciej Stachowiak <mjs@apple.com>
Date: Sat, 28 Jul 2007 17:55:54 -0700
Cc: "Web API WG (public)" <public-webapi@w3.org>
Message-Id: <D3C3DE8F-0C1E-4610-996A-1D6074DD662A@apple.com>
To: Anne van Kesteren <annevk@opera.com>

On Jul 27, 2007, at 8:49 AM, Anne van Kesteren wrote:

> Internet Explorer 7 supposedly introduced a new responseBody member  
> for XMLHttpRequest that returns an array of unsigned integers.  
> Likewise, send() now accepts such an argument. However, I've been  
> unable to make it work.  I'm planning to specify it as an Array of  
> unsigned integers. Hopefully this will be compatible with whatever  
> ES4 introduces for byte arrays.

I don't think it will be - a ByteArray is not an Array, in the current  
proposal. I think it would be better to either steal the ES4 ByteArray  
definition (it's not really tied to the rest of the language) or make  
up a custom interface for an octet sequence. An Array of unsigned  
integers is a very inefficient way to encode binary data, it will blow  
out the memory requirements by at least 4x.

> My plan for send() is that if it's passed an Array which contains  
> non-unsigned integers that those are converted to 0 and that  
> unsigned integers larger than 255 are converted to 255.

Here again I think a real ByteArray type would work better, though I  
think allowing an Array in this case is also ok.

See http://developer.mozilla.org/es4/proposals/bytearray.html for  
details on the proposal.

Received on Sunday, 29 July 2007 03:36:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:24 UTC