RSSAmplifier

(untitled) · Dec 29, 2015

How to convert an ArrayBuffer to Buffer

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

Convert an ArrayBuffer to Buffer . var isArrayBufferSupported = ( new Buffer( new Uint8Array([ 1 ]).buffer)[ 0 ] === 1 ); var arrayBufferToBuffer = isArrayBufferSupported ? arrayBufferToBufferAsArgument : arrayBufferToBufferCycle; function arrayBufferToBufferAsArgument(ab) { return new Buffer(ab); } function arrayBufferToBufferCycle(ab) { var buffer = new Buffer(ab.byteLength); var view = new…

Read on miguelmota.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.