直接访问buf.buffer属性即可将二进制NodeJS Buffer转换为JavaScript ArrayBuffer。通过原始Buffer实例写入将写入ArrayBufferView。请记住,在node.js 4.x及更高版本中,Buffer的实例也是Uint8Array的实例。示例您可以尝试以下代码片段将NodeJS buffer转换为JavaScript ArrayBuffer−function toArrayBuffer(myBuf) { var myBuffer = new ArrayBuffer(myBuf.length); var res = new Uint8Array(myBuffer); for (var i = 0; i < myBuf.length; ++i) { res[i] = myBuf[i]; } return myBuffer; }