serialize incoming data