C# FileStream IsAsync

Description

FileStream IsAsync Gets a value indicating whether the FileStream was opened asynchronously or synchronously.

Syntax

FileStream.IsAsync has the following syntax.


public virtual bool IsAsync { get; }

Example


using System.IO;/*ww  w .ja  va 2s  .co  m*/
using System;
using System.Threading;
public class MainClass{
    public static void Main()
    {
        ManualResetEvent manualEvent = new ManualResetEvent(false);
        byte[] writeArray = new byte[100000];
        new Random().NextBytes(writeArray);
    
        FileStream fStream = 
            new FileStream("Test.dat", FileMode.Create, 
            FileAccess.ReadWrite, FileShare.None, 4096, true);
    
        Console.WriteLine(fStream.IsAsync);
    
    
        manualEvent.WaitOne(5000, false);
    }
}
    




















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter