Status: Accepted
Owner: ----
Labels: Type-FeatureRequest Priority-Low

New issue 270 by christian.plesner.hansen: Add Blob type to api for holding  
binary data
http://code.google.com/p/v8/issues/detail?id=270

Add a value type to the api for holding binary data, Blob.

This should be backed by an internal ByteArray which means that like
External in that it must not be passed directly into JavaScript but must be
wrapped by an internal field.

The interface should have at least these methods:

   // Create a Blob with room for 'size' int32s.
   static Handle<Blob> NewInt32(int size);
   static Blob* Cast(Value* obj);
   int Length();
   // Read the index'th 32-bit integer
   int32_t GetInt32(int index);
   // Write the index'th 32 bit integer
   void SetInt32(int index, int32_t value);
   // Read 'length' int32s into 'buffer', starting from 'start'
   int ReadInt32(int32_t *buffer, int start, int length);
   // Write 'length' int32s from buffer into this Blob
   int WriteInt32(int32_t *buffer, int start, int length);

We may also want to add methods for treating the data as other than int32s.
  Also, an IsBlob predicate method should be added to Value.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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

Reply via email to