Generic reader/writer of binary files.