Editare

Partajați prin


UnmanagedMemoryAccessor.Initialize Method

Definition

Sets the initial values for the accessor.

protected:
 void Initialize(System::Runtime::InteropServices::SafeBuffer ^ buffer, long offset, long capacity, System::IO::FileAccess access);
protected void Initialize (System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity, System.IO.FileAccess access);
member this.Initialize : System.Runtime.InteropServices.SafeBuffer * int64 * int64 * System.IO.FileAccess -> unit
Protected Sub Initialize (buffer As SafeBuffer, offset As Long, capacity As Long, access As FileAccess)

Parameters

buffer
SafeBuffer

The buffer to contain the accessor.

offset
Int64

The byte at which to start the accessor.

capacity
Int64

The size, in bytes, of memory to allocate.

access
FileAccess

The type of access allowed to the memory. The default is ReadWrite.

Exceptions

offset plus capacity is greater than buffer.

buffer is null.

offset or capacity is less than zero.

-or-

access is not a valid MemoryMappedFileAccess enumeration value.

offset plus capacity would wrap around the high end of the address space.

Remarks

This method is called by the constructors for this class.

Applies to