you can read and write contents to buffer