向函数传入二进制数组

function \_arrayBufferToBase64( buffer ) {  
  var binary = '';  
  var bytes = new Uint8Array( buffer );  
  var len = bytes.byteLength;  
  for (var i = 0; i < len; i++) {  
    binary += String.fromCharCode( bytes\[ i \] );  
  }  
  return 'data:application/pdf;base64,'\+ window.btoa( binary );  
}

lulu
23 声望2 粉丝