Ok ok, lets just forget all code for a min. The file I'm trying to download as I said is around 17965 bytes. And I think your saying the buffer can only hold 4096 bytes at a time? So of course it will take more then one buffer load to get the whole thing.
So what I'm asking here, does the code have to stop before the buffer will get the next load? I think we've already made the point about once you've read the whole buffer theres nothing more to read, but I was exspecting the buffer to update with the next load as the code went on.