Implement read and write.