Implemented buffer read and write

as well as markbench test