Length refers to the amount of memory allocated for the buffer object. It does not change when the contents of the buffer are changed. 5 buf.write(string[, offset][, length][, encoding]) Writes a string to the buffer at offset using the given encoding. Offset defaults to 0, encoding defaults to 'utf8'. Length is the number of bytes to write.