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

◆ CreateViewStream() [3/3]

MemoryMappedViewStream System.IO.MemoryMappedFiles.MemoryMappedFile.CreateViewStream ( long offset,
long size,
MemoryMappedFileAccess access )
inline

Definition at line 294 of file MemoryMappedFile.cs.

295 {
296 if (offset < 0)
297 {
298 throw new ArgumentOutOfRangeException("offset", System.SR.ArgumentOutOfRange_NeedNonNegNum);
299 }
300 if (size < 0)
301 {
302 throw new ArgumentOutOfRangeException("size", System.SR.ArgumentOutOfRange_PositiveOrDefaultSizeRequired);
303 }
304 if (access < MemoryMappedFileAccess.ReadWrite || access > MemoryMappedFileAccess.ReadWriteExecute)
305 {
306 throw new ArgumentOutOfRangeException("access");
307 }
308 if (IntPtr.Size == 4 && size > uint.MaxValue)
309 {
310 throw new ArgumentOutOfRangeException("size", System.SR.ArgumentOutOfRange_CapacityLargerThanLogicalAddressSpaceNotAllowed);
311 }
312 MemoryMappedView view = MemoryMappedView.CreateView(_handle, access, offset, size);
313 return new MemoryMappedViewStream(view);
314 }
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.