私のC++\ CLIには、次のコードがあります。
array<Byte>^ out_buf = gcnew array<Byte>(stream_size);
Marshal::Copy(IntPtr(buf), out_buf, 0, Int32(stream_size));
System::IO::MemoryStream^ stream = gcnew MemoryStream(out_buf);
でMemoryStream(out_buf)
、メモリストリームはメモリを再度割り当てますか、それとも単に所有権を取得しout_buf
ますか?
メモリを再度割り当てる場合MemoryStream
、ネイティブバッファをに変換する方法はありMemoryStream
ますか?