On Mar 10, 1:47 pm, Ryan Dahl <[email protected]> wrote:
> A v8 byte array type would be nice (which had, say, some toString()
> methods for various encodings). I know google gears has binary Blobs,
> the XMLHttpRequest level 2 has a ByteArray (but doesn't specify what
> it would do), I think AIR and various other systems (?) also have it.
> It seems like a reasonable thing to have in v8.

How does this interface sound to you:

ByteArray([int len]);
int operator[int index];
void close(); // forces freeing of the underlying array
string toString(); // what encoding?
string toAscii(); // convert up to first entry >127.
int length(); // in bytes

Conversions to misc. string representations could/should be done via
add-on functions, i think.

Internally we could could use (unsigned char *) instead of JS Array-of-
Integer (which would be extremely costly).

:-?
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to