What's the difference between BlobBuilder and the new Blob constructor?

前端 未结 3 1328
孤独总比滥情好
孤独总比滥情好 2020-12-31 06:14

The W3 announced that they intend to deprecate the BlobBuilder API in preference for the new Blob API.

If I am already using BlobBuilder in a JavaScript app, how can

3条回答
  •  隐瞒了意图╮
    2020-12-31 07:06

    Passing an ArrayBuffer to the Blob constructor appears to be deprecated, so:

    var dataView = new DataView(arrayBuffer);
    var blob = new Blob([dataView], { type: mimeString });
    

提交回复
热议问题