Add docs about Buffer._charsWritten

Fixes GH-907.
v0.7.4-release
Ryan Dahl 2011-04-12 15:20:58 -07:00
parent 83727a4c86
commit 9b3b37e498
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,10 @@ Example: write a utf8 string into a buffer, then print it
len = buf.write('\u00bd + \u00bc = \u00be', 0); len = buf.write('\u00bd + \u00bc = \u00be', 0);
console.log(len + " bytes: " + buf.toString('utf8', 0, len)); console.log(len + " bytes: " + buf.toString('utf8', 0, len));
The number of characters written (which may be different than the number of
bytes written) is set in `Buffer._charsWritten` and will be overwritten the
next time `buf.write()` is called.
### buffer.toString(encoding, start=0, end=buffer.length) ### buffer.toString(encoding, start=0, end=buffer.length)