Use the new node "buf.wirte" api.

".write(string, encoding, offset, length)" is deprecated.
Use "write(string[, offset[, length]][, encoding])" instead.

From the node v0.8 the api has been changed.

http://nodejs.org/docs/v0.8.0/api/buffer.html#buffer_buf_write_string_offset_length_encoding