public virtual void WriteToStream(Stream stream) { if(stream==null) throw new ArgumentNullException("The parameter 'stream' can not be null."); }