Your example is a little confusing. "0123" is five bytes (NUL terminator in there), but your example output discards the NUL?
Anyway, assuming you want 'data' filled with ASCII 012301230123... with no NUL terminator, and assuming that 'data's size is a multiple of 4, and assuming C++:
assert(0...