11.17 Reader Makes Right Conversions
The use of a "reader makes right" approach avoids many data conversions.
- NetCDF-3 uses a canonical format approach in which
data stored on disk is represented in a standard way (big-endian)
- Writing and reading requires conversion between standard on-disk
representation and native (in memory) representation
- This big-endian bias favors platforms that are big-endian or
bi-endian set to big-endian, such as ARM, PowerPC, DEC Alpha, SPARC V9, MIPS, PA-RISC,
It always requires
byte-swapping conversions when writing or reading for little-endian
processors such as Intel x86.
- NetCDF-4 uses "reader-makes-right" approach, which eliminates
- With "reader-makes-right" approach
- Writer always uses native
representations, so no conversion is
necessary on writing
- Reader is responsible for detecting what representation is used and
applying a conversion, if necessary, to reader's native
- No conversion is necessary if reader and writer use same representation
- NetCDF-4 also lets writer control endianness explicitly, if necessary.