This is a neat trick, but it will segfault in architectures where alignment is enforced (like MIPS, ARM, etc) if the input buffer is not suitably aligned. One relatively cheap way to sidestep this is to memcpy into a stack-allocated struct:
Data data;
memcpy(&data, raw_buffer, sizeof data);
switch(data.data_type)
// ...