Note that this method may throw a const char* if it deems the input data to be corrupt, i.e.
that the last encoded int does not use the last byte in the data. In addition the last encoded
int need to use either the last halfbyte, or the second last followed by a 0x0 halfbyte.