new Buffer(size)


版本历史
版本变更
v10.0.0

当从 node_modules 目录外的代码运行时,则调用此构造函数会触发弃用警告。

v8.0.0

默认情况下,new Buffer(size) 将返回零填充内存。

v7.2.1

调用此构造函数不再触发弃用警告。

v7.0.0

现在调用此构造函数会触发弃用警告。

v6.0.0

弃用于: v6.0.0

稳定性: 0 - 已弃用:请改用 Buffer.alloc()(另请参阅 Buffer.allocUnsafe())。

\Stability: 0 - Deprecated: Use Buffer.alloc() instead (also see Buffer.allocUnsafe()).

  • size <integer> 新的 Buffer 所需的长度。

    \size <integer> The desired length of the new Buffer.

参见 Buffer.alloc()Buffer.allocUnsafe()。构造函数的此变体等效于 Buffer.alloc()

\See Buffer.alloc() and Buffer.allocUnsafe(). This variant of the constructor is equivalent to Buffer.alloc().

AltStyle によって変換されたページ (->オリジナル) /