file read, write buffers optimized