3.5 Generalized I/O and Compression

The public InputSource and OutputSink interfaces describe their read, write, seek, truncate, flush, sync, and reopen capabilities. Factory functions provide adapters for common sources and destinations:

ReaderOptions and WriterOptions keep buffer sizes, compression, locking, long-double encoding, and update settings local to each object. Writer options additionally include the gzip level and LZMA preset and integrity check. With path-backed objects, Compression::Auto recognizes .gz, .xz, and .lzma suffixes. Compression for a custom source or sink must be selected explicitly because there may be no filename. Compression wrappers require only sequential I/O, but seeking, page indexing, live reads, and in-place updates have the restrictions described below.