Initializes a new instance of the FileStream object for the specified file handle, with the specified read/write permission, FileStream instance ownership, synchronous or asynchronous state, and buffer size.
[Visual Basic] Overloads Public Sub New( _ ByVal handle As Integer, _ ByVal access As FileAccess, _ ByVal ownsHandle As Boolean, _ ByVal isAsync As Boolean, _ ByVal bufferSize As Integer _ ) [C#] public FileStream( int handle, FileAccess access, bool ownsHandle, bool isAsync, int bufferSize ); [C++] public: FileStream( int handle, FileAccess access, bool ownsHandle, bool isAsync, int bufferSize ); [JScript] public function FileStream( handle : int, access : FileAccess, ownsHandle : Boolean, isAsync : Boolean, bufferSize : int );
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | access is less than FileAccess.Read or greater than FileAccess.ReadWrite or bufferSize is negative. |
ArgumentException | The handle is invalid. |
IOException | An I/O error occurs. |
SecurityException | The caller does not have the required permission. |
ExecutionEngineException | ThreadPoolBindHandle failed. |
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