Serialize stream and source