so now I have a bunch of modules. It's like a assembly line. There is data flowing through and each module does something about the data, or you can say the next module consumes the output that the previous module produces. Each module is sort of expected to be standalone and reusable. This is quite a typical scenario I think.
So initially I have designed each module's interface as module(InputStream is, OutputStream os). So it can take files, whatever sources, as input and output. When you think of data flows, the previous module's outputstream is going to the next module's inputstream. But then I realise Java doesn't even have a intuitive/easy way to get data from OutputStream to InputStream. (Note: This question is not about how to achieve this. For those who is interested, How to convert OutputStream to InputStream?)
It seems to me that probably OutputStream/InputStream is not meant for purpose like this. So what is the best way to design the interface to handle data flows in this case?