MemoryMappedViewStream Class
Represents a view of a memory-mapped file as a sequentially accessed stream.
Assembly: System.Core (in System.Core.dll)
System::MarshalByRefObject
System.IO::Stream
System.IO::UnmanagedMemoryStream
System.IO.MemoryMappedFiles::MemoryMappedViewStream
| Name | Description | |
|---|---|---|
![]() | CanRead | Gets a value indicating whether a stream supports reading.(Inherited from UnmanagedMemoryStream.) |
![]() | CanSeek | Gets a value indicating whether a stream supports seeking.(Inherited from UnmanagedMemoryStream.) |
![]() | CanTimeout | Gets a value that determines whether the current stream can time out.(Inherited from Stream.) |
![]() | CanWrite | Gets a value indicating whether a stream supports writing.(Inherited from UnmanagedMemoryStream.) |
![]() | Capacity | Gets the stream length (size) or the total amount of memory assigned to a stream (capacity).(Inherited from UnmanagedMemoryStream.) |
![]() | Length | Gets the length of the data in a stream.(Inherited from UnmanagedMemoryStream.) |
![]() | PointerOffset | [Supported in the .NET Framework 4.5.1 and later versions] Gets the number of bytes by which the starting position of this view is offset from the beginning of the memory-mapped file. |
![]() | Position | Gets or sets the current position in a stream.(Inherited from UnmanagedMemoryStream.) |
![]() | PositionPointer | Gets or sets a byte pointer to a stream based on the current position in the stream.(Inherited from UnmanagedMemoryStream.) |
![]() | ReadTimeout | Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. (Inherited from Stream.) |
![]() | SafeMemoryMappedViewHandle | Gets a handle to the view of a memory-mapped file. |
![]() | WriteTimeout | Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out. (Inherited from Stream.) |
| Name | Description | |
|---|---|---|
![]() | BeginRead(array<Byte>^, Int32, Int32, AsyncCallback^, Object^) | |
![]() | BeginWrite(array<Byte>^, Int32, Int32, AsyncCallback^, Object^) | Begins an asynchronous write operation. (Consider using WriteAsync instead; see the Remarks section.)(Inherited from Stream.) |
![]() | Close() | Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed.(Inherited from Stream.) |
![]() | CopyTo(Stream^) | Reads the bytes from the current stream and writes them to another stream.(Inherited from Stream.) |
![]() | CopyTo(Stream^, Int32) | Reads the bytes from the current stream and writes them to another stream, using a specified buffer size.(Inherited from Stream.) |
![]() | CopyToAsync(Stream^) | Asynchronously reads the bytes from the current stream and writes them to another stream.(Inherited from Stream.) |
![]() | CopyToAsync(Stream^, Int32) | Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size.(Inherited from Stream.) |
![]() | CopyToAsync(Stream^, Int32, CancellationToken) | Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.(Inherited from Stream.) |
![]() | CreateObjRef(Type^) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.) |
![]() | Dispose() | |
![]() | EndRead(IAsyncResult^) | |
![]() | EndWrite(IAsyncResult^) | Ends an asynchronous write operation. (Consider using WriteAsync instead; see the Remarks section.)(Inherited from Stream.) |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Flush() | Clears all buffers for this stream and causes any buffered data to be written to the underlying file.(Overrides UnmanagedMemoryStream::Flush().) |
![]() | FlushAsync() | Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.(Inherited from Stream.) |
![]() | FlushAsync(CancellationToken) | Overrides the Stream::FlushAsync method so that the operation is cancelled if specified, but no other action is performed. Available starting in .NET Framework 4.6(Inherited from UnmanagedMemoryStream.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetLifetimeService() | Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | GetType() | |
![]() | InitializeLifetimeService() | Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | Read(array<Byte>^, Int32, Int32) | Reads the specified number of bytes into the specified array.(Inherited from UnmanagedMemoryStream.) |
![]() | ReadAsync(array<Byte>^, Int32, Int32) | Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.(Inherited from Stream.) |
![]() | ReadAsync(array<Byte>^, Int32, Int32, CancellationToken) | Asynchronously reads the specified number of bytes into the specified array. Available starting in .NET Framework 4.6(Inherited from UnmanagedMemoryStream.) |
![]() | ReadByte() | Reads a byte from a stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.(Inherited from UnmanagedMemoryStream.) |
![]() | Seek(Int64, SeekOrigin) | Sets the current position of the current stream to the given value.(Inherited from UnmanagedMemoryStream.) |
![]() | SetLength(Int64) | This API supports the product infrastructure and is not intended to be used directly from your code. Sets the length of the current stream.(Overrides UnmanagedMemoryStream::SetLength(Int64).) |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
![]() | Write(array<Byte>^, Int32, Int32) | Writes a block of bytes to the current stream using data from a buffer.(Inherited from UnmanagedMemoryStream.) |
![]() | WriteAsync(array<Byte>^, Int32, Int32) | Asynchronously writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.(Inherited from Stream.) |
![]() | WriteAsync(array<Byte>^, Int32, Int32, CancellationToken) | Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests. Available starting in .NET Framework 4.6(Inherited from UnmanagedMemoryStream.) |
![]() | WriteByte(Byte) | Writes a byte to the current position in the file stream.(Inherited from UnmanagedMemoryStream.) |
Use the CreateViewStream method of a MemoryMappedFile object to get this stream.
The following example obtains a MemoryMappedViewStream of a memory-mapped file and writes a value to the stream for inter-process communication.
This code example is part of a larger example provided for the MemoryMappedFile::CreateNew method.
Available since 4.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

