cadence
cadence copied to clipboard
dynamic support for multiple codecs
A wrapper codec is needed that chooses which codec to use for decoding by examining the first byte.
If the first byte is '{' then assume it's JSON. This isn't entirely correct because JSON doesn't always start with '{' but our JSON does so this works.
Otherwise, use the first byte for version and capability info for the codec. Version info is like "v1, v2, ..." while the capability info, if we use it, is like "uses out-of-band type encoding".