netflux
netflux

Reputation: 3818

Does Java's UrlConnection buffer the whole download in memory?

I'm using HttpURLConnection to download files using Java.

As the data is streamed, I'm transferring it to circular buffers which are by nature limited in the amount of memory they consume.

However, does HttpURLConnection store the entire stream in memory itself?

Upvotes: 0

Views: 250

Answers (1)

jtahlborn
jtahlborn

Reputation: 53694

Generally no, otherwise a java program would never be able to download anything very large. (it's possible that small responses are fully buffered in memory).

Upvotes: 2

Related Questions