StreamWriter
को फ़्लश करने के बाद Stream
फ़्लश करना आवश्यक है?डबल फ्लश की आवश्यकता है?
public static async Task WriteStringAsync(this Stream stream, string messageString)
{
var encoding = new UTF8Encoding(false); //no BOM
using (var streamWriter = new StreamWriter(stream, encoding))
{
await streamWriter.WriteAsync(messageString);
await streamWriter.FlushAsync();
}
await stream.FlushAsync(); //is this necessary?
}