
Hi Actipro, used version 19.1.687.0
This mehtod Document.SaveFile(Stream stream, Encoding encoding, LineTerminator lineTerminator) is appending the new content to the stream not overwriting the stream.
Steps to reproduce my issue:
- I have file.txt, the content of file is (test test test test). I am creating a stream from that file. stream (Lenght: 19, Position:19).
- I am loading the created stream using Document.LoadFile(Stream stream,...). The content (test test test test) is displayed, all good.
- In the EditorDocument, I change the content to (actipro), and call Document.SaveFile(stream,...), the passed stream is the same instance of the loaded stream.
- After calling the SaveFile method, the stream changed to (Lenght: 26, position:26). the new content is (test test test testactipro).
Is this expected?