arraybuffer-to-buffer

Convert ArrayBuffer to Buffer

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
arraybuffer-to-buffer
1000.0.75 years ago10 years agoMinified + gzip package size for arraybuffer-to-buffer in KB

Readme

arraybuffer-to-buffer
Convert ArrayBuffer to Buffer
Install
npm install arraybuffer-to-buffer
Usage
var arrayBufferToBuffer = require('arraybuffer-to-buffer');

var ab = new ArrayBuffer(12);
var v = new DataView(ab);
[].slice.call('abc').forEach(function(s, i) {
  v[i] = s.charCodeAt(0);
});

var b = arrayBufferToBuffer(ab);

b.toString('utf8', 0, 3); // 'abc'
License
MIT