serialize: deserialize does not need input loop