您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

test-buffer-zero-fill-reset.js 386B

12345678910111213141516171819202122
  1. 'use strict';
  2. var Buffer = require('../../').Buffer;
  3. var assert = require('assert');
  4. function testUint8Array(ui) {
  5. var length = ui.length;
  6. for (var i = 0; i < length; i++)
  7. if (ui[i] !== 0) return false;
  8. return true;
  9. }
  10. for (var i = 0; i < 100; i++) {
  11. Buffer.alloc(0);
  12. var ui = new Uint8Array(65);
  13. assert.ok(testUint8Array(ui), 'Uint8Array is not zero-filled');
  14. }