diff options
author | Shigeki Ohtsu <ohtsu@iij.ad.jp> | 2012-05-11 19:07:08 +0900 |
---|---|---|
committer | koichik <koichik@improvement.jp> | 2012-05-11 20:00:53 +0900 |
commit | cc8cfb145a2298868bd1b2520021544da5a93712 (patch) | |
tree | 951f8e4a73c0c1d86dcd22a3892b8adc3904449c | |
parent | 52f0c37d0912f3a348ef52788be604ccbd9d1a07 (diff) | |
download | node-cc8cfb145a2298868bd1b2520021544da5a93712.tar.gz |
doc: fix typo in buffer documentation
Fixes #3253.
-rw-r--r-- | doc/api/buffer.markdown | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/buffer.markdown b/doc/api/buffer.markdown index 018664224..564b715d1 100644 --- a/doc/api/buffer.markdown +++ b/doc/api/buffer.markdown @@ -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 |