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

◆ CreateViewAccessor() [3/3]

MemoryMappedViewAccessor System.IO.MemoryMappedFiles.MemoryMappedFile.CreateViewAccessor ( long offset,
long size,
MemoryMappedFileAccess access )
inline

Definition at line 326 of file MemoryMappedFile.cs.

327 {
328 if (offset < 0)
329 {
330 throw new ArgumentOutOfRangeException("offset", System.SR.ArgumentOutOfRange_NeedNonNegNum);
331 }
332 if (size < 0)
333 {
334 throw new ArgumentOutOfRangeException("size", System.SR.ArgumentOutOfRange_PositiveOrDefaultSizeRequired);
335 }
336 if (access < MemoryMappedFileAccess.ReadWrite || access > MemoryMappedFileAccess.ReadWriteExecute)
337 {
338 throw new ArgumentOutOfRangeException("access");
339 }
340 if (IntPtr.Size == 4 && size > uint.MaxValue)
341 {
342 throw new ArgumentOutOfRangeException("size", System.SR.ArgumentOutOfRange_CapacityLargerThanLogicalAddressSpaceNotAllowed);
343 }
344 MemoryMappedView view = MemoryMappedView.CreateView(_handle, access, offset, size);
345 return new MemoryMappedViewAccessor(view);
346 }
readonly SafeMemoryMappedFileHandle _handle
static string ArgumentOutOfRange_PositiveOrDefaultSizeRequired
Definition SR.cs:60
static string ArgumentOutOfRange_CapacityLargerThanLogicalAddressSpaceNotAllowed
Definition SR.cs:54
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7

References System.IO.MemoryMappedFiles.MemoryMappedFile._handle, System.SR.ArgumentOutOfRange_CapacityLargerThanLogicalAddressSpaceNotAllowed, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.SR.ArgumentOutOfRange_PositiveOrDefaultSizeRequired, System.IO.MemoryMappedFiles.MemoryMappedView.CreateView(), System.offset, and System.IntPtr.Size.