+ New method for string class to write buffer to file