Skip to content

Commit

Permalink
doc: added what buf.copy returns
Browse files Browse the repository at this point in the history
as of https://github.com/nodejs/node/blob/v5.x/src/node_buffer.cc#L555

buf.copy returns the number of bytes copied.

PR-URL: #3555
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
baslr authored and jasnell committed Dec 17, 2015
1 parent 3aecbc8 commit 8a7dd73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ if the target memory region overlaps with the source. If `undefined` the
`targetStart` and `sourceStart` parameters default to `0` while `sourceEnd`
defaults to `buffer.length`.

Returns the number of bytes copied.

Example: build two Buffers, then copy `buf1` from byte 16 through byte 19
into `buf2`, starting at the 8th byte in `buf2`.

Expand Down

0 comments on commit 8a7dd73

Please sign in to comment.