adding a method to get the buffer's content into a string.