From 9b3b37e498dfed0181a58b278eb508e1b9cf0f33 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 12 Apr 2011 15:20:58 -0700 Subject: [PATCH] Add docs about Buffer._charsWritten Fixes GH-907. --- doc/api/buffers.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/buffers.markdown b/doc/api/buffers.markdown index 30c3f03d25..ab746e4e17 100644 --- a/doc/api/buffers.markdown +++ b/doc/api/buffers.markdown @@ -55,6 +55,10 @@ Example: write a utf8 string into a buffer, then print it len = buf.write('\u00bd + \u00bc = \u00be', 0); 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)