var inputString = ''; for (var i = 0; i < buffer.byteLength; i += 10000) { var chunk = new Uint8Array(buffer, i, Math.min(10000, buffer.byteLength-i)) inputString += String.fromCharCode.apply(null, chunk); }