Share via


FileStream Constructor

Initializes a new instance of the FileStream class with the specified path, creation mode, read/write and sharing permission, and buffer size.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)

Syntax

public FileStream (
         stringpath,
         FileModemode,
         FileAccessaccess,
         FileShareshare,
         intbufferSize
)

Parameters

  • path
    A relative or absolute path for the file that the current FileStream object will encapsulate.
  • mode
    A FileMode constant that determines how to open or create the file.
  • access
    A FileAccess constant that determines how the file can be accessed by the FileStream object. This gets the CanRead and CanWrite properties of the FileStream object. CanSeek is true if path specifies a disk file.
  • share
    A FileShare constant that determines how the file will be shared by processes.
  • bufferSize
    A positive Int32 value greater than 0 indicating the buffer size. For bufferSize values between one and eight, the actual buffer size is set to eight bytes.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, and 4.1.

See Also

Reference

FileStream Class
FileStream Members
System.IO Namespace