target: add helper functions to get/set u16 or u32 array from/to buffer