46 public void Initialize(uint numElements, uint sizeOfEachElement)
48 Initialize((ulong)numElements * (ulong)sizeOfEachElement);
80 public unsafe T
Read<T>(ulong byteOffset) where
T :
struct
87 byte* ptr = (
byte*)(
void*)
handle + byteOffset;
106 [CLSCompliant(
false)]
128 [CLSCompliant(
false)]
136 byte* ptr = (
byte*)(
void*)
handle + byteOffset;
138 bool success =
false;
143 for (
int i = 0; i <
buffer.Length; i++)
157 [CLSCompliant(
false)]
165 byte* ptr = (
byte*)(
void*)
handle + byteOffset;
167 bool success =
false;
182 [CLSCompliant(
false)]
204 [CLSCompliant(
false)]
212 byte* ptr = (
byte*)(
void*)
handle + byteOffset;
213 SpaceCheck(ptr, checked((nuint)(num * data.Length)));
214 bool success =
false;
219 for (
int i = 0; i < data.Length; i++)
239 if ((ulong)(ptr - (
byte*)(
void*)
handle) > (ulong)(
_numBytes - sizeInBytes))
258 if (num == 1 || num == 2)
262 return (uint)((num + 3) & -4);
271 return (uint)
Unsafe.SizeOf<T>();
static void Memmove(ref byte dest, ref byte src, nuint len)
unsafe void WriteSpan< T >(ulong byteOffset, ReadOnlySpan< T > data)
static void NotEnoughRoom()
unsafe void SpaceCheck(byte *ptr, nuint sizeInBytes)
void ReadArray< T >(ulong byteOffset, T[] array, int index, int count)
void Initialize(ulong numBytes)
unsafe T Read< T >(ulong byteOffset)
unsafe void Write< T >(ulong byteOffset, T value)
unsafe void ReadSpan< T >(ulong byteOffset, Span< T > buffer)
void Initialize< T >(uint numElements)
static InvalidOperationException NotInitialized()
SafeBuffer(bool ownsHandle)
void WriteArray< T >(ulong byteOffset, T[] array, int index, int count)
static uint SizeOf< T >()
unsafe void AcquirePointer(ref byte *pointer)
static uint AlignedSizeOf< T >()
static nuint Uninitialized
void Initialize(uint numElements, uint sizeOfEachElement)
void DangerousAddRef(ref bool success)
static string Arg_BufferTooSmall
static string InvalidOperation_MustCallInitialize
static string ArgumentOutOfRange_UIntPtrMax
static string ArgumentNull_Buffer
static string Argument_InvalidOffLen
static string ArgumentOutOfRange_NeedNonNegNum
static string Argument_NeedStructWithNoRefs