Stream
フラッシュした後にフラッシュする必要がありStreamWriter
ますか?
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?
}