I want to parse information out of the text file this serves up:
http://finance.yahoo.com/d/quotes.txt?s=GOOG+YHOO&f=sak2
Is there a way to do it within an app without downloading the file first? Somehow stream the text content?
I want to parse information out of the text file this serves up:
http://finance.yahoo.com/d/quotes.txt?s=GOOG+YHOO&f=sak2
Is there a way to do it within an app without downloading the file first? Somehow stream the text content?
Open a Http connection to the URL (using either the builtin HttpURLConnection or use a library like commons-httpclient), and read the results from the input stream as the contents are transferred.
It is impossible to read the file without transferring the contents of the file over the network. However, you don't need to transfer the contents and store the file on disk - you can simply read the file from the stream and not persist it to disk.