The specified String is written to the underlying stream unless the end of the stream is reached prematurely.
Flush is invoked automatically if AutoFlush is true. If value is null, no entries are written.
StreamWriter.Write may throw IndexOutOfRangeException if the stream state becomes corrupted. In Windows Phone, the stream state may become corrupted if multiple threads write to or read from a stream object without using synchronization.