Пример #1
0
 // From https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfilescatter:
 // "The file handle must be created with [...] the FILE_FLAG_OVERLAPPED and FILE_FLAG_NO_BUFFERING flags."
 private static bool CanUseScatterGatherWindowsAPIs(SafeFileHandle handle)
 => handle.IsAsync && ((handle.GetFileOptions() & SafeFileHandle.NoBuffering) != 0);