I don't know what's happening to you specifically, but I do observe
this behavior with regular web browsers and certain broken web
servers. The server will get an error, either consistently or
occasionally, and fail in such a way that the browser just sees a
close.

If there's no Content-Length: header, the browser has no way to know
that the content has been truncated.

So if the web server is under your control, I'd suggest making sure
the Content-Length: header is set (and set correctly).

The other observation I'll make is you're copying the data a byte at a
time. This will be far slower than allocating a byte array as a
buffer, and copying a buffer at a time. It shouldn't make a difference
in behavior. Just be sure to pass the returned length from the
read(..) call (if not negative) as the length to the write(...) call.

On Nov 9, 8:46 pm, Android Humanoid <[email protected]> wrote:
> No... nothing in logcat, download competed in 0sec am getting, but
> there is nothing in the file.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to