Why does BinaryWriter append unwanted character to the end of a xml file in vb.net



I am using below code for writing xml file.


Dim downloadFile As New FileInfo("c:\test.xml") Using bw As New BinaryWriter(downloadFile.OpenWrite) bw.Write(Buffer) 'Buffer is Byte array bw.Close() End Using


but in each file, there is unwanted character(as showing snapshot) is coming at the end of file. unwanted character


how to avoid this during writing to the file.


No comments:

Post a Comment