简体   繁体   中英

How to cache image downloaded from URL in Java?

I have downloaded an image from a URL using ImageIO.write, so now I am wondering if there was a possibility of somehow caching that image. Is there a possibility to compare the downloaded image with the URL it's downloaded from to know that the image is from that URL? I need this because if I download an image and than later call that same URL for downloading, my app can recognize that it already has the image downloaded, so it doesn't download it again.

You should try to see if you can integrate the code to upload the picture to google and search by image. Or, you can also save the url of the image with an array while storing the image if you have multiple images you want to download at once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM