This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

doc: fix typo in buffer documentation

Fixes #3253.
  • Loading branch information...
shigeki authored and koichik committed May 11, 2012
1 parent 52f0c37 commit cc8cfb145a2298868bd1b2520021544da5a93712
Showing with 4 additions and 4 deletions.
  1. +4 −4 doc/api/buffer.markdown
View
@@ -66,7 +66,7 @@ Allocates a new buffer containing the given `str`.
* `string` String - data to be written to buffer
* `offset` Number, Optional, Default: 0
-* `length` Number, Optional
+* `length` Number, Optional, Default: `buffer.length - offset`
* `encoding` String, Optional, Default: 'utf8'
Writes `string` to the buffer at `offset` using the given encoding.
@@ -89,7 +89,7 @@ next time `buf.write()` is called.
* `encoding` String, Optional, Default: 'utf8'
* `start` Number, Optional, Default: 0
-* `end` Number, Optional
+* `end` Number, Optional, Default: `buffer.length`
Decodes and returns a string from buffer data encoded with `encoding`
(defaults to `'utf8'`) beginning at `start` (defaults to `0`) and ending at
@@ -167,7 +167,7 @@ buffer object. It does not change when the contents of the buffer are changed.
* `targetBuffer` Buffer object - Buffer to copy into
* `targetStart` Number, Optional, Default: 0
* `sourceStart` Number, Optional, Default: 0
-* `sourceEnd` Number, Optional, Default: 0
+* `sourceEnd` Number, Optional, Default: `buffer.length`
Does copy between buffers. The source and target regions can be overlapped.
`targetStart` and `sourceStart` default to `0`.
@@ -193,7 +193,7 @@ into `buf2`, starting at the 8th byte in `buf2`.
### buf.slice([start], [end])
* `start` Number, Optional, Default: 0
-* `end` Number, Optional, Default: 0
+* `end` Number, Optional, Default: `buffer.length`
Returns a new buffer which references the same memory as the old, but offset
and cropped by the `start` (defaults to `0`) and `end` (defaults to

0 comments on commit cc8cfb1

Please sign in to comment.