This project has moved and is read-only. For the latest updates, please go here.

A bug when save to a stream

Topics: Project Management Forum
Apr 19, 2012 at 7:31 AM
The methods 
"public void Save(Stream outStream, Encoding encoding)"
" public void Save(Stream outStream)"
 in class HtmlDocument,declare a StreamWriter for writing data to stream with default bufferSize.
But not with a flush or close method at end of wirte.So some data in buffer will be lost.
System.IO.MemoryStream ms = new MemoryStream();
 htmldoc.Save(ms, System.Text.Encoding.UTF8);		
Chang the method "public void Save(StreamWriter writer)" in HtmlDocument as following:
public void Save(StreamWriter writer)
            writer.Flush();       //add Flush method to write buffer data to stream