Getting an array of bytes out of Windows::Storage::Streams::IBuffer

后端 未结 7 1291
囚心锁ツ
囚心锁ツ 2020-12-01 11:22

I have an object that implements the interface Windows::Storage::Streams::IBuffer, and I want to get an array of bytes out of it, however while looking at the d

7条回答
  •  暖寄归人
    2020-12-01 11:58

    Also check this method:

    IBuffer -> Platform::Array
    CryptographicBuffer.CopyToByteArray

    Platform::Array -> IBuffer
    CryptographicBuffer.CreateFromByteArray

    As a side note, if you want to create Platform::Array from simple C++ array you could use Platform::ArrayReference, for example:

    char* c = "sdsd";
    Platform::ArrayReference arraywrapper((unsigned char*) c, sizeof(c));
    

提交回复
热议问题