2008 Unidata NetCDF Workshop for Developers and Data Providers > Introduction to NetCDF-4
11.15 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,
and IA64.
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
big-endian bias.
- 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
representation
- No conversion is necessary if reader and writer use same representation
- NetCDF-4 also lets writer control endianness explicitly, if necessary.
2008 Unidata NetCDF Workshop for Developers and Data Providers > Introduction to NetCDF-4