I have a Class, that expects an InputStream on input. Currently I am loading a text file from filesystem and creating FileInputStream, that is passed to this Class.
What I need is to eliminate the need of file in filesystem to be able to create an InputStream.
So I came up with solutions like:
- Storing a file into String variable and creating Stream out of it (escaping chars need to be done)
- Storing a file into byte array with hex values (no need to escape chars or care about content)
I am wondering if there is any other way to achieve this.