<br>randomaccess file reading on a remote unix box<br>
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michael_Berg
Posted On:   Tuesday, July 16, 2002 02:32 PM

This is my question: I have a large file on a remote unix box that needs to be read every 5 minutes. Using the following code it takes over 15 minutes: FtpClient fc; try { FtpClient client = new FtpClient(host2); client.login(username, password); client.cd(directory); InputStream is = client.get(filename); InputStreamReader isr = new InputStreamReader(is); BufferedReader in = new BufferedReader(isr); while((strLine = in.readLine()) != null) { pullOutTheExceptions(strLine, path); checkForErrors(strLine, path); } Instead of usi   More>>


This is my question:


I have a large file on a remote unix box that needs to be read every 5 minutes.

Using the following code it takes over 15 minutes:



FtpClient fc;

try {

FtpClient client = new FtpClient(host2);

client.login(username, password);

client.cd(directory);

InputStream is = client.get(filename);

InputStreamReader isr = new InputStreamReader(is);

BufferedReader in = new BufferedReader(isr);


while((strLine = in.readLine()) != null) {

pullOutTheExceptions(strLine, path);

checkForErrors(strLine, path);

}



Instead of using the BufferedReader class I need to be able to perform a seek() using the RandomAccessFile class to keep track of the position for the next time.



Can you help me!

   <<Less

Re: <br>randomaccess file reading on a remote unix box<br>

Posted By:   Christopher_Koenigsberg  
Posted On:   Tuesday, July 16, 2002 02:59 PM

Maybe you could compress the remote source file, so your ftp retrieval would go faster. Then decompress a copy locally and do your random access there.

About | Sitemap | Contact