if lsb is 2 bytes trash then 6 bytes good data, you just want to do this:
int rawData = (msb << 6) | lsb;
if it's 6 bytes good data, then 2 bytes trash, your version is fine.
if lsb is 2 bytes trash then 6 bytes good data, you just want to do this:
int rawData = (msb << 6) | lsb;
if it's 6 bytes good data, then 2 bytes trash, your version is fine.