Skip to content

Commit

Permalink
Documentation update about Buffer initialization
Browse files Browse the repository at this point in the history
per: nodejs/node-v0.x-archive@53b6a61

fixes nodejs/node-v0.x-archive#7230

Original commit patch did not apply cleanly

Originally contributed by @sarathms
  • Loading branch information
jasnell committed Aug 4, 2015
1 parent f32f822 commit e603452
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ Allocates a new buffer of `size` bytes. `size` must be less than
2,147,483,648 bytes (2 GB) on 64 bits architectures,
otherwise a `RangeError` is thrown.

Unlike `ArrayBuffers`, the underlying memory for buffers is not initialized. So
the contents of a newly created `Buffer` is unknown. Use `buf.fill(0)`to
initialize a buffer to zeroes.

### new Buffer(array)

* `array` Array
Expand Down

0 comments on commit e603452

Please sign in to comment.