Buffer Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Manipulates arrays of primitive types.
Assembly: mscorlib (in mscorlib.dll)
The Buffer type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | BlockCopy | Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset. |
![]() ![]() | ByteLength | Returns the number of bytes in the specified array. |
![]() ![]() | GetByte | Retrieves the byte at a specified location in a specified array. |
![]() ![]() | SetByte | Assigns a specified value to a byte at a particular location in a specified array. |
Buffer only affects arrays of primitive types; this class does not apply to objects. Each primitive type is treated as a series of bytes without regard to any behavior or limitation associated with the primitive type.
Buffer provides methods to copy bytes from one array of primitive types to another array of primitive types, get a byte from an array, set a byte in an array, and obtain the length of an array. This class provides better performance for manipulating primitive types than similar methods in the System::Array class.
Buffer is applicable to the following primitive types: Boolean, Char, SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Single, and Double.

