<param name="fileStream">The file stream of the existing file.</param>
<param name="mapName">A name to assign to the memory-mapped file, or <see langword="null" /> for a <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFile" /> that you do not intend to share across processes.</param>
<param name="capacity">The maximum size, in bytes, to allocate to the memory-mapped file. Specify 0 to set the capacity to the size of <c>filestream</c>.</param>
- <param name="access">One of the enumeration values that specifies the type of access allowed to the memory-mapped file.
- This parameter can't be set to <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" />.</param>
+ <param name="access">One of the enumeration values that specifies the type of access allowed to the memory-mapped file.
+This parameter can't be set to <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" />.</param>
<param name="inheritability">One of the enumeration values that specifies whether a handle to the memory-mapped file can be inherited by a child process. The default is <see cref="F:System.IO.HandleInheritability.None" />.</param>
<param name="leaveOpen">A value that indicates whether to close the source file stream when the <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFile" /> is disposed.</param>
<returns>A memory-mapped file that has the specified characteristics.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="mapName" /> is <see langword="null" /> or an empty string.
--or-
-<paramref name="capacity" /> and the length of the file are zero.
--or-
-<paramref name="access" /> is set to <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> or <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> enumeration value, which is not allowed.
--or-
+ <paramref name="mapName" /> is <see langword="null" /> or an empty string.
+-or-
+<paramref name="capacity" /> and the length of the file are zero.
+-or-
+<paramref name="access" /> is set to <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> or <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> enumeration value, which is not allowed.
+-or-
<paramref name="access" /> is set to <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Read" /> and <paramref name="capacity" /> is larger than the length of <see langword="filestream" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="fileStream" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is less than zero.
--or-
-<paramref name="capacity" /> is less than the file size.
--or-
-<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.
--or-
+ <paramref name="capacity" /> is less than zero.
+-or-
+<paramref name="capacity" /> is less than the file size.
+-or-
+<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.
+-or-
<paramref name="inheritability" /> is not a valid <see cref="T:System.IO.HandleInheritability" /> enumeration value.</exception>
</member>
<member name="M:System.IO.MemoryMappedFiles.MemoryMappedFile.CreateFromFile(System.String)">
<param name="path">The path to file to map.</param>
<returns>A memory-mapped file.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
--or-
+ <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
+-or-
<paramref name="path" /> refers to an invalid device.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<param name="mode">Access mode; must be <see cref="F:System.IO.FileMode.Open" />.</param>
<returns>A memory-mapped file that has the specified access mode.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
--or-
-<paramref name="path" /> refers to an invalid device.
--or-
+ <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
+-or-
+<paramref name="path" /> refers to an invalid device.
+-or-
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Append" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.IOException">
- <paramref name="mode" /> is <see cref="F:System.IO.FileMode.Create" />, <see cref="F:System.IO.FileMode.CreateNew" />, or <see cref="F:System.IO.FileMode.Truncate" />.
--or-
-<paramref name="mode" /> is <see cref="F:System.IO.FileMode.OpenOrCreate" /> and the file on disk does not exist.
--or-
+ <paramref name="mode" /> is <see cref="F:System.IO.FileMode.Create" />, <see cref="F:System.IO.FileMode.CreateNew" />, or <see cref="F:System.IO.FileMode.Truncate" />.
+-or-
+<paramref name="mode" /> is <see cref="F:System.IO.FileMode.OpenOrCreate" /> and the file on disk does not exist.
+-or-
An I/O error occurred.</exception>
<exception cref="T:System.IO.PathTooLongException">
<paramref name="path" /> exceeds the maximum length defined by the operating system.</exception>
<param name="mapName">A name to assign to the memory-mapped file, or <see langword="null" /> for a <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFile" /> that you do not intend to share across processes.</param>
<returns>A memory-mapped file that has the specified name and access mode.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
--or-
-<paramref name="path" /> refers to an invalid device.
--or-
-<paramref name="mapName" /> is an empty string.
--or-
+ <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
+-or-
+<paramref name="path" /> refers to an invalid device.
+-or-
+<paramref name="mapName" /> is an empty string.
+-or-
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Append" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.IOException">
- <paramref name="mode" /> is <see cref="F:System.IO.FileMode.Create" />, <see cref="F:System.IO.FileMode.CreateNew" />, or <see cref="F:System.IO.FileMode.Truncate" />.
--or-
-<paramref name="mode" /> is <see cref="F:System.IO.FileMode.OpenOrCreate" /> and the file on disk does not exist.
--or-
+ <paramref name="mode" /> is <see cref="F:System.IO.FileMode.Create" />, <see cref="F:System.IO.FileMode.CreateNew" />, or <see cref="F:System.IO.FileMode.Truncate" />.
+-or-
+<paramref name="mode" /> is <see cref="F:System.IO.FileMode.OpenOrCreate" /> and the file on disk does not exist.
+-or-
An I/O error occurred.</exception>
<exception cref="T:System.IO.PathTooLongException">
<paramref name="path" /> exceeds the maximum length defined by the operating system.</exception>
<param name="capacity">The maximum size, in bytes, to allocate to the memory-mapped file. Specify 0 to set the capacity to the size of the file on disk.</param>
<returns>A memory-mapped file that has the specified characteristics.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
--or-
-<paramref name="path" /> refers to an invalid device.
--or-
-<paramref name="mapName" /> is an empty string.
--or-
+ <paramref name="path" /> is an empty string, contains only white space, or has one or more invalid characters, as defined by the <see cref="M:System.IO.Path.GetInvalidFileNameChars" /> method.
+-or-
+<paramref name="path" /> refers to an invalid device.
+-or-
+<paramref name="mapName" /> is an empty string.
+-or-
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Append" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is greater than the size of the logical address space.
--or-
-<paramref name="capacity" /> is less than zero.
--or-
-<paramref name="capacity" /> is less than the file size (but not zero).
--or-
+ <paramref name="capacity" /> is greater than the size of the logical address space.
+-or-
+<paramref name="capacity" /> is less than zero.
+-or-
+<paramref name="capacity" /> is less than the file size (but not zero).
+-or-
<paramref name="capacity" /> is zero, and the size of the file on disk is also zero.</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<exception cref="T:System.IO.PathTooLongException">
<param name="access">One of the enumeration values that specifies the type of access allowed to the memory-mapped file.</param>
<returns>A memory-mapped file that has the specified characteristics.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="mapName" /> is an empty string.
--or-
-<paramref name="access" /> is not an allowed value.
--or-
-<paramref name="path" /> specifies an empty file.
--or-
-<paramref name="access" /> is specified as <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Read" /> and capacity is greater than the size of the file indicated by <paramref name="path" />.
--or-
+ <paramref name="mapName" /> is an empty string.
+-or-
+<paramref name="access" /> is not an allowed value.
+-or-
+<paramref name="path" /> specifies an empty file.
+-or-
+<paramref name="access" /> is specified as <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Read" /> and capacity is greater than the size of the file indicated by <paramref name="path" />.
+-or-
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Append" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is greater than the size of the logical address space.
--or-
-<paramref name="capacity" /> is less than zero.
--or-
-<paramref name="capacity" /> is less than the file size (but not zero).
--or-
-<paramref name="capacity" /> is zero, and the size of the file on disk is also zero.
--or-
-<paramref name="access" /> is not a defined <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> value.
--or-
+ <paramref name="capacity" /> is greater than the size of the logical address space.
+-or-
+<paramref name="capacity" /> is less than zero.
+-or-
+<paramref name="capacity" /> is less than the file size (but not zero).
+-or-
+<paramref name="capacity" /> is zero, and the size of the file on disk is also zero.
+-or-
+<paramref name="access" /> is not a defined <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> value.
+-or-
The size of the file indicated by <paramref name="path" /> is greater than <paramref name="capacity" />.</exception>
- <exception cref="T:System.IO.IOException">-or-
- An I/O error occurred.</exception>
+ <exception cref="T:System.IO.IOException">-or-
+An I/O error occurred.</exception>
<exception cref="T:System.IO.PathTooLongException">
<paramref name="path" /> exceeds the maximum length defined by the operating system.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have the required permissions for the file.</exception>
<param name="access">One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.ReadWrite" />.</param>
<returns>A memory-mapped file that has the specified characteristics.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="mapName" /> is an empty string.
--or-
+ <paramref name="mapName" /> is an empty string.
+-or-
<paramref name="access" /> is set to write-only with the <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> enumeration value.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is less than or equal to zero.
--or-
+ <paramref name="capacity" /> is less than or equal to zero.
+-or-
<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.</exception>
<exception cref="T:System.PlatformNotSupportedException">.NET Core only: Calls to the <c>CreateNew</c> method with a named memory mapped file (that is, a non-null <paramref name="mapName" />) are supported on Windows operating systems only.</exception>
</member>
<param name="inheritability">A value that specifies whether a handle to the memory-mapped file can be inherited by a child process. The default is <see cref="F:System.IO.HandleInheritability.None" />.</param>
<returns>A memory-mapped file that has the specified characteristics.</returns>
<exception cref="T:System.ArgumentException">
- <paramref name="mapName" /> is an empty string.
--or-
+ <paramref name="mapName" /> is an empty string.
+-or-
<paramref name="access" /> is set to write-only with the <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> enumeration value.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is less than or equal to zero.
--or-
-<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.
--or-
+ <paramref name="capacity" /> is less than or equal to zero.
+-or-
+<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.
+-or-
<paramref name="inheritability" /> is not a valid <see cref="T:System.IO.HandleInheritability" /> value.</exception>
<exception cref="T:System.PlatformNotSupportedException">.NET Core only: Calls to the <c>CreateNew</c> method with a named memory mapped file (that is, a non-null <paramref name="mapName" />) are supported on Windows operating systems only.</exception>
</member>
<exception cref="T:System.ArgumentException">
<paramref name="mapName" /> is an empty string.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is greater than the size of the logical address space.
--or-
+ <paramref name="capacity" /> is greater than the size of the logical address space.
+-or-
<paramref name="capacity" /> is less than or equal to zero.</exception>
</member>
<member name="M:System.IO.MemoryMappedFiles.MemoryMappedFile.CreateOrOpen(System.String,System.Int64,System.IO.MemoryMappedFiles.MemoryMappedFileAccess)">
<exception cref="T:System.ArgumentNullException">
<paramref name="mapName" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
- <paramref name="mapName" /> is an empty string.
--or-
+ <paramref name="mapName" /> is an empty string.
+-or-
<paramref name="access" /> is set to write-only with the <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> enumeration value.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is greater than the size of the logical address space.
--or-
-<paramref name="capacity" /> is less than or equal to zero.
--or-
+ <paramref name="capacity" /> is greater than the size of the logical address space.
+-or-
+<paramref name="capacity" /> is less than or equal to zero.
+-or-
<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.</exception>
<exception cref="T:System.UnauthorizedAccessException">The operating system denied the specified access to the file; for example, access is set to <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> or <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.ReadWrite" />, but the file or directory is read-only.</exception>
</member>
<exception cref="T:System.ArgumentNullException">
<paramref name="mapName" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
- <paramref name="mapName" /> is an empty string.
--or-
+ <paramref name="mapName" /> is an empty string.
+-or-
<paramref name="access" /> is set to write-only with the <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> enumeration value.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="capacity" /> is greater than the size of the logical address space.
--or-
-<paramref name="capacity" /> is less than or equal to zero.
--or-
-<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.
--or-
+ <paramref name="capacity" /> is greater than the size of the logical address space.
+-or-
+<paramref name="capacity" /> is less than or equal to zero.
+-or-
+<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.
+-or-
<paramref name="inheritability" /> is not a valid <see cref="T:System.IO.HandleInheritability" /> enumeration value.</exception>
<exception cref="T:System.UnauthorizedAccessException">The operating system denied the specified access to the file; for example, access is set to <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.Write" /> or <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.ReadWrite" />, but the file or directory is read-only.</exception>
</member>
<param name="size">The size of the view. Specify 0 (zero) to create a view that starts at <paramref name="offset" /> and ends approximately at the end of the memory-mapped file.</param>
<returns>A randomly accessible block of memory.</returns>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="offset" /> or <paramref name="size" /> is a negative value.
--or-
+ <paramref name="offset" /> or <paramref name="size" /> is a negative value.
+-or-
<paramref name="size" /> is greater than the logical address space.</exception>
<exception cref="T:System.UnauthorizedAccessException">Access to the memory-mapped file is unauthorized.</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<param name="access">One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.ReadWrite" />.</param>
<returns>A randomly accessible block of memory.</returns>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="offset" /> or <paramref name="size" /> is a negative value.
--or-
+ <paramref name="offset" /> or <paramref name="size" /> is a negative value.
+-or-
<paramref name="size" /> is greater than the logical address space.</exception>
<exception cref="T:System.UnauthorizedAccessException">
<paramref name="access" /> is invalid for the memory-mapped file.</exception>
<param name="size">The size of the view. Specify 0 (zero) to create a view that starts at <paramref name="offset" /> and ends approximately at the end of the memory-mapped file.</param>
<returns>A stream of memory that has the specified offset and size.</returns>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="offset" /> or <paramref name="size" /> is a negative value.
--or-
+ <paramref name="offset" /> or <paramref name="size" /> is a negative value.
+-or-
<paramref name="size" /> is greater than the logical address space.</exception>
<exception cref="T:System.UnauthorizedAccessException">Access to the memory-mapped file is unauthorized.</exception>
<exception cref="T:System.IO.IOException">
<param name="access">One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is <see cref="F:System.IO.MemoryMappedFiles.MemoryMappedFileAccess.ReadWrite" />.</param>
<returns>A stream of memory that has the specified characteristics.</returns>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="offset" /> or <paramref name="size" /> is a negative value.
--or-
-<paramref name="size" /> is greater than the logical address space.
--or-
+ <paramref name="offset" /> or <paramref name="size" /> is a negative value.
+-or-
+<paramref name="size" /> is greater than the logical address space.
+-or-
<paramref name="access" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileAccess" /> enumeration value.</exception>
<exception cref="T:System.UnauthorizedAccessException">
<paramref name="access" /> is invalid for the memory-mapped file.</exception>
<exception cref="T:System.IO.IOException">
- <paramref name="size" /> is greater than the total virtual memory.
--or-
+ <paramref name="size" /> is greater than the total virtual memory.
+-or-
<paramref name="access" /> is invalid for the memory-mapped file.</exception>
</member>
<member name="M:System.IO.MemoryMappedFiles.MemoryMappedFile.Dispose">
<exception cref="T:System.ArgumentException">
<paramref name="mapName" /> is an empty string.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="desiredAccessRights" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileRights" /> enumeration value.
--or-
+ <paramref name="desiredAccessRights" /> is not a valid <see cref="T:System.IO.MemoryMappedFiles.MemoryMappedFileRights" /> enumeration value.
+-or-
<paramref name="inheritability" /> is not a valid <see cref="T:System.IO.HandleInheritability" /> enumeration value.</exception>
<exception cref="T:System.UnauthorizedAccessException">The requested access is invalid for the memory-mapped file.</exception>
<exception cref="T:System.IO.FileNotFoundException">The file specified for <paramref name="mapName" /> does not exist.</exception>