在我的C++ \ CLI我有這段代碼:轉換本地緩衝區的MemoryStream
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
的所有權?
if MemoryStream
does does allocate memory again,there's way to convert native buffer to MemoryStream
?