if you are REALLY SURE, that it will only be decimal numbers you can go as easy as this:
char digit1 = sample[i];
int value1 = digit1 - '0';
char digit0 = sample[i+1];
int value0 = digit0 - '0'; int number = value1 * 10 + value0;
byteBuffer[n] = (byte) number;
The value number is ensured to be below 128 (7 bits), so you can spare out 1 bit and save the value in 7 bits. But that is advanced stuff and you should understand it like
here from Microsoft fine explained.