{ "id": "91928", "key": "TIMOB-9159", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2012-05-16T16:34:03.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:07.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "To go from a Buffer to a Blob we have Buffer.toBlob. However, there's no matching Blob.toBuffer. This would be handy since Buffers are more easily mutable than blobs, and some methods only accept one type or the other.\r\n\r\nI think the current workaround for Blob > Buffer is something like:\r\n\r\n{code}\r\nvar blobStream = Ti.Stream.createStream({ source: myBlob, mode: Ti.Stream.MODE_READ });\r\nvar newBuffer = Ti.createBuffer({ length: myBlob.length });\r\nvar bytes = blobStream.read(newBuffer);\r\n{code}\r\n\r\nThis is muy ugly. It seems like it would be a lot simpler to add support for creating a buffer from a Blob in Ti.createBuffer:\r\n\r\n{code}\r\nvar buffer = Ti.createBuffer({ value: myBlob });\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "Ti API: Easier way to convert between Blobs and Buffers", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }