108 handle.EnsureThreadPoolBindingInitialized();
165 protected sealed override void Dispose(
bool disposing)
183 internal sealed override void Flush(
bool flushToDisk)
193 if (origin < SeekOrigin.Begin || origin >
SeekOrigin.End)
206 long num = origin
switch
208 SeekOrigin.Begin =>
offset,
228 internal sealed override void Lock(
long position,
long length)
ThreadPoolBoundHandle? ThreadPoolBinding
static SafeFileHandle Open(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize)
static string GetFullPath(string path)
static unsafe void WriteAtOffset(SafeFileHandle handle, ReadOnlySpan< byte > buffer, long fileOffset)
static unsafe int ReadAtOffset(SafeFileHandle handle, Span< byte > buffer, long fileOffset)
static ValueTask WriteAtOffsetAsync(SafeFileHandle handle, ReadOnlyMemory< byte > buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy strategy=null)
static unsafe long GetFileLength(SafeFileHandle handle)
static ValueTask< int > ReadAtOffsetAsync(SafeFileHandle handle, Memory< byte > buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy strategy=null)
static void SetFileLength(SafeFileHandle handle, long length)
static void Lock(SafeFileHandle handle, bool canWrite, long position, long length)
static void Unlock(SafeFileHandle handle, long position, long length)
static void FlushToDisk(SafeFileHandle handle)
static long Seek(SafeFileHandle handle, long offset, SeekOrigin origin, bool closeInvalidHandle=false)
static void ThrowInvalidArgument(SafeFileHandle handle)
override void Write(ReadOnlySpan< byte > buffer)
bool LengthCachingSupported
override int Read(Span< byte > buffer)
OSFileStreamStrategy(SafeFileHandle handle, FileAccess access)
override Task FlushAsync(CancellationToken cancellationToken)
override void Lock(long position, long length)
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override void SetLength(long value)
override long Seek(long offset, SeekOrigin origin)
override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
override ValueTask< int > ReadAsync(Memory< byte > destination, CancellationToken cancellationToken)
override void Write(byte[] buffer, int offset, int count)
override void Dispose(bool disposing)
override int EndRead(IAsyncResult asyncResult)
OSFileStreamStrategy(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize)
override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
override void EndWrite(IAsyncResult asyncResult)
override ValueTask WriteAsync(ReadOnlyMemory< byte > source, CancellationToken cancellationToken)
override int Read(byte[] buffer, int offset, int count)
override Task< int > ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override void Unlock(long position, long length)
void OnIncompleteOperation(int expectedBytesTransferred, int actualBytesTransferred)
override void DisposeInternal(bool disposing)
readonly SafeFileHandle _fileHandle
unsafe override int ReadByte()
void SetLengthCore(long value)
override ValueTask DisposeAsync()
readonly FileAccess _access
unsafe override void WriteByte(byte value)
override void Flush(bool flushToDisk)
static string IO_SeekAppendOverwrite
static string IO_UnknownFileName
static string IO_SetLengthAppendTruncate
static string Argument_InvalidSeekOrigin
static int Add(ref int location1, int value)
static IAsyncResult Begin(Task task, AsyncCallback callback, object state)
static void End(IAsyncResult asyncResult)
static Task CompletedTask
static bool Read(ref bool location)
static void ThrowNotSupportedException_UnwritableStream()
static void ThrowNotSupportedException_UnseekableStream()
static void ThrowObjectDisposedException_FileClosed()
static void ThrowNotSupportedException_UnreadableStream()
static ValueTask CompletedTask