[][src]Module dap2::dods

Data response

The DODS response consists of a DDS response followed by the string: Data:\n\n and the XDR encoded data.

XDR encoding

XDR encoded data are always big-endian. The smallest size is 4 bytes, so data is padded to this. Strings or opaque types are padded to be divisible by 4 bytes.

Length

Arrays are prepended with their XDR encoded length as u32 twice. While scalars do not. A Structure or Grid is sent as each member sequentially.

XDR types

  • Byte
  • Int16
  • UInt16
  • Int32
  • UInt32
  • Float32
  • Float64
  • String
  • URL

See the OPeNDAP documentation. This seems to deviate from the other XDR specification where each type must be minimum 4 bytes.

Strings

Strings seem to be XDR encoded by first sending the length (as u32 big endian) of the number of elements. Then each string is prepended with the string length of that element, then the string is sent null-terminated.

Traits

Dods

A DODS response streaming the DDS header and the (possibly) constrained variable data.

Functions

xdr_length

XDR encoded length.