Implement write() and read() for bucketgen file.