在我的 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
?