wait for data to be written completely?
Posted on 2006-04-14
My program uses a DataOutputStream to write a load of data from a file (a bunch of 1024 element byte arrays) to a web server (via HTTP).
No matter how big the file is, it does this very very quickly - and then updates a progress bar for each packet of data that it sends. However, it then pauses for quite some time [while the progress bar says 100%] - while it waits for the server to respond to the file that's been uploaded... (As if it's waiting for the data to make it's way through the network cables before responding).
This is not exactly what I'm after...
It's updating the progress bar immediately after writing the data -- and not once the data has been recieved by the server... how can I solve this?
My output stream is defined as:
out = new DataOutputStream( new BufferedOutputStream( os ) ) ;