Converts data from incoming packets with explicit types to custom classes, and vice versa for the outgoing packets.