Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadAtOffset()

static unsafe int System.IO.RandomAccess.ReadAtOffset ( SafeFileHandle handle,
Span< byte > buffer,
long fileOffset )
inlinestaticpackage

Definition at line 231 of file RandomAccess.cs.

232 {
233 if (handle.IsAsync)
234 {
236 }
238 fixed (byte* bytes = &MemoryMarshal.GetReference(buffer))
239 {
241 {
242 return numBytesRead;
243 }
246 {
247 38 => numBytesRead,
248 109 => 0,
249 _ => throw Win32Marshal.GetExceptionForWin32Error(lastWin32ErrorAndDisposeHandleIfInvalid, handle.Path),
250 };
251 }
252 }
static unsafe int ReadFile(IntPtr handle, byte *bytes, int numBytesToRead, out int numBytesRead, IntPtr mustBeZero)
static Memory< byte > buffer
static unsafe int ReadSyncUsingAsyncHandle(SafeFileHandle handle, Span< byte > buffer, long fileOffset)
static NativeOverlapped GetNativeOverlappedForSyncHandle(SafeFileHandle handle, long fileOffset)
static Memory< byte > long fileOffset
static int GetLastWin32ErrorAndDisposeHandleIfInvalid(SafeFileHandle handle)

References System.IO.RandomAccess.buffer, System.bytes, System.IO.RandomAccess.fileOffset, System.IO.Win32Marshal.GetExceptionForWin32Error(), System.IO.Strategies.FileStreamHelpers.GetLastWin32ErrorAndDisposeHandleIfInvalid(), System.IO.RandomAccess.GetNativeOverlappedForSyncHandle(), System.handle, Interop.Kernel32.ReadFile(), and System.IO.RandomAccess.ReadSyncUsingAsyncHandle().

Referenced by Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal(), System.IO.RandomAccess.Read(), System.IO.Strategies.OSFileStreamStrategy.Read(), and System.IO.RandomAccess.ReadScatterAtOffset().