CryptographicBuffer.CreateFromByteArray(Byte[]) CryptographicBuffer.CreateFromByteArray(Byte[]) CryptographicBuffer.CreateFromByteArray(Byte[]) CryptographicBuffer.CreateFromByteArray(Byte[]) CryptographicBuffer.CreateFromByteArray(Byte[]) Method

Definition

Creates a buffer from an input byte array.

public : static IBuffer CreateFromByteArray(Byte[] value)
static IBuffer CreateFromByteArray(Byte[] value) const;
public static IBuffer CreateFromByteArray(Byte[] value)
Public Shared Function CreateFromByteArray(value As Byte[]) As IBuffer
var iBuffer = Windows.Security.Cryptography.CryptographicBuffer.createFromByteArray(value);

Parameters

value
Byte[] Byte[] Byte[]

An array of bytes used to create the buffer.

Returns

Output buffer.

Examples

public void ByteArrayCopy()
{
    // Initialize a byte array.
    byte[] arrByte = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

    // Create a buffer from the byte array.
    IBuffer buffer = CryptographicBuffer.CreateFromByteArray(arrByte);

    // Encode the buffer into a hexadecimal string (for display);
    String strHex = CryptographicBuffer.EncodeToHexString(buffer);

    // Copy the buffer back into a new byte array.
    byte[] arrByteNew;
    CryptographicBuffer.CopyToByteArray(buffer, out arrByteNew);
}