Finalizes use of buffers for reading and writing data