mscorlib(4.0.0.0) API with additions
System.Buffer Class Reference

Manipulates arrays of primitive types. More...

Public Member Functions

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 Public Member Functions

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...
 

Detailed Description

Manipulates arrays of primitive types.

Definition at line 11 of file Buffer.cs.

Member Function Documentation

◆ 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
srcThe source buffer.
srcOffsetThe zero-based byte offset into src .
dstThe destination buffer.
dstOffsetThe zero-based byte offset into dst .
countThe number of bytes to copy.
Exceptions
T:System.ArgumentNullExceptionsrc or dst is null.
T:System.ArgumentExceptionsrc 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.ArgumentOutOfRangeExceptionsrcOffset , 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
arrayAn array.
Returns
The number of bytes in the array.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentExceptionarray is not a primitive.
T:System.OverflowExceptionarray 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
arrayAn array.
indexA location in the array.
Returns
Returns the index byte in the array.
Exceptions
T:System.ArgumentExceptionarray is not a primitive.
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is negative or greater than the length of array .
T:System.OverflowExceptionarray 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
sourceThe address of the bytes to copy.
destinationThe target address.
destinationSizeInBytesThe number of bytes available in the destination memory block.
sourceBytesToCopyThe number of bytes to copy.
Exceptions
T:System.ArgumentOutOfRangeExceptionsourceBytesToCopy 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
sourceThe address of the bytes to copy.
destinationThe target address.
destinationSizeInBytesThe number of bytes available in the destination memory block.
sourceBytesToCopyThe number of bytes to copy.
Exceptions
T:System.ArgumentOutOfRangeExceptionsourceBytesToCopy 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
arrayAn array.
indexA location in the array.
valueA value to assign.
Exceptions
T:System.ArgumentExceptionarray is not a primitive.
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is negative or greater than the length of array .
T:System.OverflowExceptionarray 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: