I am assuming that your sources/sinks are the Java objects and that your C++ library needs to read from the Java InputStream
and write to Java OutputStream
instances and that you need a facade of C++ IO streams that you can pass down to your C++ parts that will call back for data into your Java objects.
I suggest implementing C++ IO streams facade for the Java streams using the Boost.Iostreams library. Browse the docs and examples. What you want is the stream_buffer
and stream
classes together with your own implementation of Sink and Source concepts (see also Device concept and device
class).
UPDATE
To implement seeking you need to implement the SeekableDevice concept and provide appropriate tag in your device's category
.