Stack Exchange
How to download the response of images which comes in array?
As I am using angular 5 as front end and spring boot as backend...Here is the situation to download the response (JSON) of images...

are you saving image as blob format?

  try{
     String fileName = "digital_image_processing.jpg";
     String website = "http://tutorialspoint.com/java_dip/images/"+fileName;

     System.out.println("Downloading File From: " + website);

     URL url = new URL(website);
     InputStream inputStream = url.openStream();
     OutputStream outputStream = new FileOutputStream(fileName);
     byte[] buffer = new byte[2048];

     int length = 0;

     while ((length = inputStream.read(buffer)) != -1) {
        System.out.println("Buffer Read of length: " + length);
        outputStream.write(buffer, 0, length);
     }

     inputStream.close();
     outputStream.close();

  }catch(Exception e){
     System.out.println("Exception: " + e.getMessage());
  }


Posting code without any explanations isn't welcome here (and won't help people who are looking for the solution). Would you please edit your answer?
