Partage via


CryptographicBuffer.CreateFromByteArray(Byte[]) Méthode

Définition

Crée une mémoire tampon à partir d’un tableau d’octets d’entrée.

public:
 static IBuffer ^ CreateFromByteArray(Platform::Array <byte> ^ value);
 static IBuffer CreateFromByteArray(winrt::array_view <byte> const& value);
public static IBuffer CreateFromByteArray(byte[] value);
function createFromByteArray(value)
Public Shared Function CreateFromByteArray (value As Byte()) As IBuffer

Paramètres

value

Byte[]

byte[]

Tableau d’octets utilisé pour créer la mémoire tampon.

Retours

Mémoire tampon de sortie.

Exemples

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);
}

S’applique à