@@ -31,10 +31,10 @@ All of the examples in the documentation can be run similarly.
3131
3232Pure Javascript is Unicode friendly but not nice to pure binary data. When
3333dealing with TCP streams or the file system, it's necessary to handle octet
34- streams. Node has several stratagies for manipulating, creating, and
34+ streams. Node has several strategies for manipulating, creating, and
3535consuming octet streams.
3636
37- Raw data is stored in instaces of the ` Buffer ` class. A ` Buffer ` is similar
37+ Raw data is stored in instances of the ` Buffer ` class. A ` Buffer ` is similar
3838to an array of integers but correspond to a raw memory allocation outside
3939the V8 heap. A ` Buffer ` cannot be resized.
4040Access the class at ` require('buffer').Buffer ` .
@@ -59,29 +59,14 @@ Binary (`"binary"`). `"ascii"` and `"binary"` only look at the first 8 bits
5959of the 16bit JavaScript string characters. The following ` Buffer ` methods
6060allow decoding and encoding of strings:
6161
62- - ** ` buffer.utf8Write (string, offset) ` ** : Writes ` string ` to the buffer at
63- ` offset ` using UTF-8 encoding. Returns the number of octets written. If
62+ - ** ` buffer.write (string, encoding , offset) ` ** : Writes ` string ` to the buffer at
63+ ` offset ` using the given encoding. Returns number of octets written. If
6464` buffer ` did not contain enough space to fit the entire string it will write
65- a partial amount of the string. However, this method will not write partial
66- characters.
65+ a partial amount of the string. In the case of ` encoding=='utf8' ` , the
66+ method will not write partial characters.
6767
68- - ** ` buffer.binaryWrite(string, offset) ` ** : Writes ` string ` to the buffer at
69- ` offset ` using binary encoding - that is it will only use the first 8 bits
70- of each character. Write a partial string if not enough space remains.
71- Returns number of octets written.
72-
73- - ** ` buffer.asciiWrite(string, offset) ` ** : Writes ` string ` to the buffer at
74- ` offset ` using ASCII encoding. Faster than ` utf8Write() ` . Write a partial
75- string if not enough space remains. Returns number of octets written.
76-
77- - ** ` buffer.utf8Slice(start, end) ` ** : Decodes and returns a string assuming
78- UTF-8 encoding beginning at ` start ` and ending at ` end ` .
79-
80- - ** ` buffer.binarySlice(start, end) ` ** : Decodes and returns a string assuming
81- binary encoding beginning at ` start ` and ending at ` end ` .
82-
83- - ** ` buffer.asciiSlice(start, end) ` ** : Decodes and returns a string assuming
84- ASCII encoding beginning at ` start ` and ending at ` end ` .
68+ - ** ` buffer.toString(encoding, start, end) ` ** : Decodes and returns a string assuming
69+ in the given encoding beginning at ` start ` and ending at ` end ` .
8570
8671
8772
0 commit comments