项目原始demo,不改动
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

123456789101112131415161718192021222324252627
  1. # to-arraybuffer [![Build Status](https://travis-ci.org/jhiesey/to-arraybuffer.svg?branch=master)](https://travis-ci.org/jhiesey/to-arraybuffer)
  2. [![Sauce Test Status](https://saucelabs.com/browser-matrix/to-arraybuffer.svg)](https://saucelabs.com/u/to-arraybuffer)
  3. Convert from a Buffer to an ArrayBuffer as fast as possible.
  4. Note that in some cases the returned ArrayBuffer is backed by the same memory as the original
  5. Buffer (but in other cases it is a copy), so **modifying the ArrayBuffer is not recommended**.
  6. This module is designed to work both in node.js and in all browsers with ArrayBuffer support
  7. when using [the Buffer implementation provided by Browserify](https://www.npmjs.com/package/buffer).
  8. ## Usage
  9. ``` js
  10. var toArrayBuffer = require('to-arraybuffer')
  11. var buffer = new Buffer(100)
  12. // Fill the buffer with some data
  13. var ab = toArrayBuffer(buffer)
  14. // `ab` now contains the same data as `buffer`
  15. ```
  16. ## License
  17. MIT