Writing to llvm::raw_ostream

Hi, for a certain use case I need to write byte streams to an llvm::raw_ostream (similar to how it can be done fo std::ofstream(fileName, std::ios::binary) ).

Is there a way to do that?

As a second part to the same question, is it possible to set seek to a particular position for an llvm::raw_ostream. Even that would work for me.

Thanks!

I believe a raw_ostream is always in "Binary" mode - do you see
behavior contrary to that?

& seeking - I believe some raw_ostream supports seeking, perhaps
specifically only the fd_ostream? ah, raw_pwrite_ostream:
https://llvm.org/doxygen/raw__ostream_8h_source.html#l00471