I'm trying to use SWIG to create a Go wrapper for a C++ API that uses std::istream to read binary data. I'd like to be able to pass an io.Reader to these APIs, but I'm not sure how to create a mapping between it and std::istream. I know I need to implement a std::streambuf subclass and I assume the rest will involve directors and typemaps, but I'm not familiar enough with SWIG to figure out the right combination.
Any ideas?