Doubt on processing files created from Input stream

There is one client application that sends data to a port at a very high speed. Data come to the port as line by line.

One thread reads these line data from the server port by using BufferdReader.readline() and creats temporary files ie each line data will be saved to a file. To be more precise, with every line, a different temp file will be created.

Another thread should fetch temp files from the same folder where temp files are getting created.

These fetched temp files are then taken for processing ( Identifying data, parsing, populating java beans and database insertion.)

I am having problem in fetching files from the directory and processing.

Can anyone give me a tip to accomplish this task.

[742 byte] By [Shambhu_79a] at [2007-10-3 2:13:37]
# 1
> I am having problem in fetching files from the> directory and processing.> Can anyone give me a tip to accomplish this task.Wanna tell us what your problem(s) are so we can help you?
tjacobs01a at 2007-7-14 19:12:28 > top of Java-index,Archived Forums,Socket Programming...
# 2
Your purpose can be best served by using thePipedInputStream and PipedOutputStream forcommunicating lines betweent the two threads.no need of writing to files first and then readingfrom the files.
PMJaina at 2007-7-14 19:12:28 > top of Java-index,Archived Forums,Socket Programming...
# 3

I will just say that this is a very strange design. Is each line is a self-contained transaction? There's not much point in filling up your disk with these data files: that's just allowing the cllients to get miles ahead of the processing. I would just process each line as it comes in, without the data files, the extra thread, &c. If that's slower than the clients can send, good, they will stall.

ejpa at 2007-7-14 19:12:28 > top of Java-index,Archived Forums,Socket Programming...