Processes a stream of bytes into an IP packet containing either UDP or TCP