diff options
author | Jackson Tian <shyvo1987@gmail.com> | 2016-04-25 10:36:57 +0800 |
---|---|---|
committer | Jackson Tian <shyvo1987@gmail.com> | 2016-04-27 13:23:41 +0800 |
commit | e556dd3856d42ae8e94e27846b8cf7c1dfff05d3 (patch) | |
tree | 43801cfa990096ed1e9ad5451d76ca231647b67f /doc/api/string_decoder.md | |
parent | cee4c25c9281d106f80b20ba7854bf9003f9357a (diff) | |
download | android-node-v8-e556dd3856d42ae8e94e27846b8cf7c1dfff05d3.tar.gz android-node-v8-e556dd3856d42ae8e94e27846b8cf7c1dfff05d3.tar.bz2 android-node-v8-e556dd3856d42ae8e94e27846b8cf7c1dfff05d3.zip |
doc: use Buffer.from() instead of new Buffer()
Use new API of Buffer to developers in most documents.
PR-URL: https://github.com/nodejs/node/pull/6367
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Diffstat (limited to 'doc/api/string_decoder.md')
-rw-r--r-- | doc/api/string_decoder.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/string_decoder.md b/doc/api/string_decoder.md index d1de27dc4a..f979e7dd37 100644 --- a/doc/api/string_decoder.md +++ b/doc/api/string_decoder.md @@ -10,10 +10,10 @@ additional support for utf8. const StringDecoder = require('string_decoder').StringDecoder; const decoder = new StringDecoder('utf8'); -const cent = new Buffer([0xC2, 0xA2]); +const cent = Buffer.from([0xC2, 0xA2]); console.log(decoder.write(cent)); -const euro = new Buffer([0xE2, 0x82, 0xAC]); +const euro = Buffer.from([0xE2, 0x82, 0xAC]); console.log(decoder.write(euro)); ``` |