Manipulates arrays of primitive types.
More...
|
static void | BlockCopy (Array src, int srcOffset, Array dst, int dstOffset, int count) |
| Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset. More...
|
|
|
static byte | GetByte (Array array, int index) |
| Retrieves the byte at a specified location in a specified array. More...
|
|
static void | SetByte (Array array, int index, byte value) |
| Assigns a specified value to a byte at a particular location in a specified array. More...
|
|
static int | ByteLength (Array array) |
| Returns the number of bytes in the specified array. More...
|
|
static unsafe void | MemoryCopy (void *source, void *destination, long destinationSizeInBytes, long sourceBytesToCopy) |
| Copies a number of bytes specified as a long integer value from one address in memory to another. This API is not CLS-compliant. More...
|
|
static unsafe void | MemoryCopy (void *source, void *destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) |
| Copies a number of bytes specified as an unsigned long integer value from one address in memory to another. This API is not CLS-compliant. More...
|
|
Manipulates arrays of primitive types.
Definition at line 11 of file Buffer.cs.
◆ BlockCopy()
static void System.Buffer.BlockCopy |
( |
Array |
src, |
|
|
int |
srcOffset, |
|
|
Array |
dst, |
|
|
int |
dstOffset, |
|
|
int |
count |
|
) |
| |
Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset.
- Parameters
-
src | The source buffer. |
srcOffset | The zero-based byte offset into src . |
dst | The destination buffer. |
dstOffset | The zero-based byte offset into dst . |
count | The number of bytes to copy. |
- Exceptions
-
T:System.ArgumentNullException | src or dst is null . |
T:System.ArgumentException | src or dst is not an array of primitives.-or- The number of bytes in src is less than srcOffset plus count .-or- The number of bytes in dst is less than dstOffset plus count . |
T:System.ArgumentOutOfRangeException | srcOffset , dstOffset , or count is less than 0. |
◆ ByteLength()
static int System.Buffer.ByteLength |
( |
Array |
array | ) |
|
|
static |
Returns the number of bytes in the specified array.
- Parameters
-
- Returns
- The number of bytes in the array.
- Exceptions
-
T:System.ArgumentNullException | array is null . |
T:System.ArgumentException | array is not a primitive. |
T:System.OverflowException | array is larger than 2 gigabytes (GB). |
Definition at line 183 of file Buffer.cs.
◆ GetByte()
static byte System.Buffer.GetByte |
( |
Array |
array, |
|
|
int |
index |
|
) |
| |
|
static |
Retrieves the byte at a specified location in a specified array.
- Parameters
-
array | An array. |
index | A location in the array. |
- Returns
- Returns the index byte in the array.
- Exceptions
-
T:System.ArgumentException | array is not a primitive. |
T:System.ArgumentNullException | array is null . |
T:System.ArgumentOutOfRangeException | index is negative or greater than the length of array . |
T:System.OverflowException | array is larger than 2 gigabytes (GB). |
Definition at line 116 of file Buffer.cs.
◆ MemoryCopy() [1/2]
static unsafe void System.Buffer.MemoryCopy |
( |
void * |
source, |
|
|
void * |
destination, |
|
|
long |
destinationSizeInBytes, |
|
|
long |
sourceBytesToCopy |
|
) |
| |
|
static |
Copies a number of bytes specified as a long integer value from one address in memory to another. This API is not CLS-compliant.
- Parameters
-
source | The address of the bytes to copy. |
destination | The target address. |
destinationSizeInBytes | The number of bytes available in the destination memory block. |
sourceBytesToCopy | The number of bytes to copy. |
- Exceptions
-
T:System.ArgumentOutOfRangeException | sourceBytesToCopy is greater than destinationSizeInBytes . |
Definition at line 416 of file Buffer.cs.
◆ MemoryCopy() [2/2]
static unsafe void System.Buffer.MemoryCopy |
( |
void * |
source, |
|
|
void * |
destination, |
|
|
ulong |
destinationSizeInBytes, |
|
|
ulong |
sourceBytesToCopy |
|
) |
| |
|
static |
Copies a number of bytes specified as an unsigned long integer value from one address in memory to another. This API is not CLS-compliant.
- Parameters
-
source | The address of the bytes to copy. |
destination | The target address. |
destinationSizeInBytes | The number of bytes available in the destination memory block. |
sourceBytesToCopy | The number of bytes to copy. |
- Exceptions
-
T:System.ArgumentOutOfRangeException | sourceBytesToCopy is greater than destinationSizeInBytes . |
Definition at line 435 of file Buffer.cs.
◆ SetByte()
static void System.Buffer.SetByte |
( |
Array |
array, |
|
|
int |
index, |
|
|
byte |
value |
|
) |
| |
|
static |
Assigns a specified value to a byte at a particular location in a specified array.
- Parameters
-
array | An array. |
index | A location in the array. |
value | A value to assign. |
- Exceptions
-
T:System.ArgumentException | array is not a primitive. |
T:System.ArgumentNullException | array is null . |
T:System.ArgumentOutOfRangeException | index is negative or greater than the length of array . |
T:System.OverflowException | array is larger than 2 gigabytes (GB). |
Definition at line 151 of file Buffer.cs.
The documentation for this class was generated from the following file: