I'm trying to get a program to scan web pages and it sort of works. As is reads the source it makes decisions based on what it finds, and writes to the disk. However it will only write so much then stop. My code is made to show what is being written as it being written. Though my program shows the file is being scanned all the way to the end, the file that is being written will stop at the spot every time. My code looks like this:
Don't forget to close the input and output streams (by calling close() on them). Some streams have a buffer, and if you don't close or flush the stream properly, part of the data might not be written to the actual file.