ByteArrayOutputStream baos = null;
  try
  {
   URL u = new URL(strUrl);
   BufferedImage image = ImageIO.read(u);
   
         //convert BufferedImage to byte array
   baos = new ByteArrayOutputStream();
   ImageIO.write( image, "jpg", baos);
   baos.flush();
   
   return baos.toByteArray();
  }
  catch (Exception e)
  {
  }
  finally
  {
   if(baos != null)
   {
    try {
     baos.close();
    } catch (IOException e) {
    }
   }
  }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
相关资源
相似解决方案