title: Get image with given url and convert it to byte array
body: <p>I have an image url (<a href="http://example.com/myimage.jpg" rel="nofollow noreferrer">http://example.com/myimage.jpg</a>) and want to convert it to byte array and save it in my DB.</p>
  
  <p>I did the following, but getting this message <code>URI scheme is not "file"</code></p>
  
  <pre><code>URI uri = new URI(profileImgUrl);
  File fnew = new File(uri);
  BufferedImage originalImage=ImageIO.read(fnew);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  ImageIO.write(originalImage, "jpg", baos );
  byte[] imageInByte=baos.toByteArray();
  </code></pre>