It should be : version = buffer[3] + (buffer[2] << 8);