Sample I/O