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.


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: