static void EncodeFlags (byte[] buf, ref int index, short type, int value) { EncodeTypeAndLength (buf, ref index, type, 4); EncodeInt32 (buf, ref index, value); }