The following code is supposed to copy the contents of<BR>a memory stream (ms) to a file stream.<BR>It seems to cut off just before the end of the memory stream.<BR>any one have any idea why that could be?<BR>I tried using<BR><BR>fs.SetLength(ms.Length)<BR><BR>and even to be sure:<BR><BR>fs.SetLength(ms.Length+1000)<BR><BR>i t didnt work.<BR><BR><BR><BR>Dim fs As FileStream = New FileStream("myxmlfile.xml", FileMode.OpenOrCreate)<BR> Try<BR> ms.WriteTo(fs)<BR> Catch e As Exception<BR> Dim sr As StreamWriter = New StreamWriter(fs)<BR> sr.WriteLine("error occurred:" + e.Message)<BR> End Try<BR> fs.Close()<BR>