Node.js examples for Data Type:Uint16Array
Convert ArrayBuffer to and from String
'use strict';/*from w w w. j a v a 2s. c o m*/ /** * @credit https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String?hl=en */ function arrayBufferToString(buffer) { return String.fromCharCode.apply(null, new Uint16Array(buffer)); }