static void EncodeIfNotNull(RestrictedDescribed section, ByteBuffer buffer) { if (section != null) { section.Encode(buffer); } }
// Transport layer should call Codec to encode/decode frames. It ensures that // all dependant static fields in other class are initialized correctly. // NETMF does not track cross-class static field/ctor dependencies public static void Encode(RestrictedDescribed command, ByteBuffer buffer) { Fx.Assert(command != null, "command is null!"); command.Encode(buffer); }