base class for conversion from packet to stream