title: Load image from URL and limit the size of the file
body: <p>I have found how to load an image from an Url using this question on SO : <a href="https://stackoverflow.com/questions/926938/how-to-load-a-image-from-web-in-java">how to load a image from web in java</a></p>
  
  <p>But I'd like to limit the size of the file being loaded because all the answers have this in common : if a user give the url to a one terabyte file, it will crashes my server :/</p>
  
  <p>How can I limit the size of the file being downloaded ?</p>
  
  <p>Thanks for your help! :)</p>