1

I have two java processes and I have to write data generated from one process as an input to the other java process. The data stream generated will be of the size of 5GB . How can I do that.

Do I have to use a buffer file and read and write inputstream/outputstream into that file. Is there no other method or a more efficient method?

Thanks

ssD
  • 339
  • 2
  • 9
  • 22

1 Answers1

0

You could use Sockets rather than an intermediate file.

http://www.exampledepot.com/egs/java.net/WriteTextToSocket.html

http://www.exampledepot.com/egs/java.net/ReadFromSocket.html

If you're using threads (and not processes), a PipedInputStream should work.

qwerty
  • 3,801
  • 2
  • 28
  • 43