Initializes a new instance of the FileStream object for the specified file handle, with the specified read/write permission and FileStream instance ownership.
[Visual Basic] Overloads Public Sub New( _ ByVal handle As Integer, _ ByVal access As FileAccess, _ ByVal ownsHandle As Boolean _ ) [C#] public FileStream( int handle, FileAccess access, bool ownsHandle ); [C++] public: FileStream( int handle, FileAccess access, bool ownsHandle ); [JScript] public function FileStream( handle : int, access : FileAccess, ownsHandle : Boolean );
Exception Type | Condition |
---|---|
ArgumentException | access is not a field of FileAccess. |
SecurityException | The caller does not have the required FileIOPermission. |
The FileStream object is given the specified access to the file. The ownership of the handle will be as specified. If this process owns the handle, a call to the Close method will also close the handle. In particular, the file's handle count is decremented. The FileStream object is given a buffer size of 8192 bytes.
NGWS Runtime Security:
FileIOPermissionAccess | Read flag required by FileAccess.Read and FileAccess.ReadWrite. |
FileIOPermissionAccess | Write flag required by FileAccess.Write and FileAccess.ReadWrite. |
FileStream Class | FileStream Members | System.IO Namespace | FileStream Constructor Overload List