MemoryMappedViewAccessor 类    
   
定义 
    
      
    一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
 
	
	public ref class MemoryMappedViewAccessor sealed : System::IO::UnmanagedMemoryAccessorpublic sealed class MemoryMappedViewAccessor : System.IO.UnmanagedMemoryAccessortype MemoryMappedViewAccessor = class
    inherit UnmanagedMemoryAccessorPublic NotInheritable Class MemoryMappedViewAccessor
Inherits UnmanagedMemoryAccessor
			继承 
			
				
			 
		 
	示例 
	以下示例从大型内存映射文件中获取 MemoryMappedViewAccessor  进行编辑。
此代码示例是为 MemoryMappedFile  类提供的一个更大示例的一部分。
// Create a random access view, from the 256th megabyte (the offset)
// to the 768th megabyte (the offset plus length).
using (var accessor = mmf.CreateViewAccessor(offset, length))
{
    int colorSize = Marshal.SizeOf(typeof(MyColor));
    MyColor color;
    // Make changes to the view.
    for (long i = 0; i < length; i += colorSize)
    {
        accessor.Read(i, out color);
        color.Brighten(10);
        accessor.Write(i, ref color);
    }
}
' Create a random access view, from the 256th megabyte (the offset)
' to the 768th megabyte (the offset plus length).
Using accessor = mmf.CreateViewAccessor(offset, length)
    Dim colorSize As Integer = Marshal.SizeOf(GetType(MyColor))
    Dim color As MyColor
    Dim i As Long = 0
    ' Make changes to the view.
    Do While (i < length)
        accessor.Read(i, color)
        color.Brighten(10)
        accessor.Write(i, color)
        i += colorSize
    Loop
End Using
              CreateViewAccessor 使用 对象的 方法MemoryMappedFile 获取此视图。
	
		属性
	 
	
	
		方法
	 
	
        	
	
		
			Dispose() 
		 
	 
	
		释放由 UnmanagedMemoryAccessor  使用的所有资源。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Dispose(Boolean) 
		 
	 
	
		释放由 UnmanagedMemoryAccessor  占用的非托管资源,还可以另外再释放托管资源。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Equals(Object) 
		 
	 
	
		确定指定对象是否等于当前对象。
		(继承自 Object )
	 
        	 
        	
	
	
		Flush() 
	 
 
	
		清除此视图的所有缓冲区,使得所有缓冲的数据都被写入到基础文件。
	 
        	 
        	
	
		
			GetHashCode() 
		 
	 
	
		作为默认哈希函数。
		(继承自 Object )
	 
        	 
        	
	
		
			GetType() 
		 
	 
	
		获取当前实例的 Type 。
		(继承自 Object )
	 
        	 
        	
	
		
			Initialize(SafeBuffer, Int64, Int64, FileAccess) 
		 
	 
	
		设置访问器的初始值。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			MemberwiseClone() 
		 
	 
	
		创建当前 Object  的浅表副本。
		(继承自 Object )
	 
        	 
        	
	
		
			Read<T>(Int64, T) 
		 
	 
	
		将 T 类型的结构从访问器读取到提供的引用中。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadArray<T>(Int64, T[], Int32, Int32) 
		 
	 
	
		将 T 类型的结构从访问器读取到 T 类型的数组中。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadBoolean(Int64) 
		 
	 
	
		从访问器读取一个布尔值。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadByte(Int64) 
		 
	 
	
		从访问器读取一个字节值。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadChar(Int64) 
		 
	 
	
		从访问器读取一个字符。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadDecimal(Int64) 
		 
	 
	
		从访问器读取一个小数值。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadDouble(Int64) 
		 
	 
	
		从访问器读取一个双精度浮点值。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadInt16(Int64) 
		 
	 
	
		从访问器读取一个 16 位整数。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadInt32(Int64) 
		 
	 
	
		从访问器读取一个 32 位整数。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadInt64(Int64) 
		 
	 
	
		从访问器读取一个 64 位整数。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadSByte(Int64) 
		 
	 
	
		从访问器读取一个 8 位带符号整数。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadSingle(Int64) 
		 
	 
	
		从访问器读取一个单精度浮点值。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadUInt16(Int64) 
		 
	 
	
		从访问器读取一个 16 位无符号整数。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadUInt32(Int64) 
		 
	 
	
		从访问器读取一个 32 位无符号整数。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ReadUInt64(Int64) 
		 
	 
	
		从访问器读取一个 64 位无符号整数。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			ToString() 
		 
	 
	
		返回表示当前对象的字符串。
		(继承自 Object )
	 
        	 
        	
	
		
			Write(Int64, Boolean) 
		 
	 
	
		将一个布尔值写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Byte) 
		 
	 
	
		将一个字节值写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Char) 
		 
	 
	
		将一个字符写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Decimal) 
		 
	 
	
		将一个小数值写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Double) 
		 
	 
	
		将一个 Double  值写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Int16) 
		 
	 
	
		将一个 16 位整数写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Int32) 
		 
	 
	
		将一个 32 位整数写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Int64) 
		 
	 
	
		将一个 64 位整数写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, SByte) 
		 
	 
	
		将一个 8 位整数写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, Single) 
		 
	 
	
		将一个 Single  写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, UInt16) 
		 
	 
	
		将一个 16 位无符号整数写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, UInt32) 
		 
	 
	
		将一个 32 位无符号整数写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write(Int64, UInt64) 
		 
	 
	
		将一个 64 位无符号整数写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			Write<T>(Int64, T) 
		 
	 
	
		将一个结构写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
        	
	
		
			WriteArray<T>(Int64, T[], Int32, Int32) 
		 
	 
	
		将结构从 T 类型的数组写入访问器。
		(继承自 UnmanagedMemoryAccessor )
	 
        	 
	
	 适用于 
	 
      
    
	另请参阅