Hi everyone,
This is fairly a basic question and I am somehow confused how to implement it due to my lack of experience with
Java I/O.
I have an XML document that I am gerneating on the fly and writing it out to a file with PrintWriter out statements on a FileOutputStream.
I want to achieve the following:
I want another class (exists within the same JVM) to get hold of this XML document without reading it out of the file. In other words, I want everything to remain in memory, so that no file system is involved.
Is it possible to write the contents of the XML document out on the stream into the memory and have my other java program simply read it in through an input stream (without any sockets).
I am not sure whether this is possible, so any help would be appreciated. Even some sample code would be nice. THANKS!