System.IO.FileStream.FileStream C# (CSharp) Method

FileStream() public method

public FileStream ( System.IO.SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync ) : System.Threading
handle System.IO.SafeFileHandle
access FileAccess
bufferSize int
isAsync bool
return System.Threading
        public FileStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync)
        {
            if (handle.IsInvalid)
                throw new ArgumentException(SR.Arg_InvalidHandle, nameof(handle));

            if (access < FileAccess.Read || access > FileAccess.ReadWrite)
                throw new ArgumentOutOfRangeException(nameof(access), SR.ArgumentOutOfRange_Enum);
            if (bufferSize <= 0)
                throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum);

            if (handle.IsClosed)
                throw new ObjectDisposedException(SR.ObjectDisposed_FileClosed);
            if (handle.IsAsync.HasValue && isAsync != handle.IsAsync.Value)
                throw new ArgumentException(SR.Arg_HandleNotAsync, nameof(handle));

            _access = access;
            _useAsyncIO = isAsync;
            _exposedHandle = true;
            _bufferLength = bufferSize;
            _fileHandle = handle;

            InitFromHandle(handle);
        }

Same methods

FileStream::FileStream ( System.IO.SafeFileHandle handle, FileAccess access ) : System.Threading
FileStream::FileStream ( System.IO.SafeFileHandle handle, FileAccess access, int bufferSize ) : System.Threading
FileStream::FileStream ( string path, FileMode mode ) : System.Threading
FileStream::FileStream ( string path, FileMode mode, FileAccess access ) : System.Threading
FileStream::FileStream ( string path, FileMode mode, FileAccess access, FileShare share ) : System.Threading
FileStream::FileStream ( string path, FileMode mode, FileAccess access, FileShare share, int bufferSize ) : System.Threading
FileStream::FileStream ( string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options ) : System.Threading
FileStream::FileStream ( string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync ) : System.Threading