How to pass data from native std::ostream to managed code stream in C++/CLI

I am writing C++/CLI wrapper on a C++ library. The constructor of C++ library take std::ostream as input which it then use to write some logs. I need to make c++ library functionality available in c# code. So I need a way for users of managed library wrapper to get data back which is received from native c++ library. I need to pass ostream to c++ library and then write the data to c# stream. How can I do it in managed wrapper code? Can someone please provide an example? I can find lots of examples for string marshalling. I cannot find any related to streams.