Improve read()/write() performance.