buffer.update accepts string or buffer