Maison  >  Questions et réponses  >  le corps du texte

java读取本地png图片到byte数组?

File file = new File(path);
FileInputStream fis = new FileInputStream(file);
byte[] img_content = new byte[(int) file.length()];
fis.read(img_content);
fis.close();

图片是存在的
读入的内容全是0 是什么情况???

黄舟黄舟2743 Il y a quelques jours511

répondre à tous(1)je répondrai

  • 怪我咯

    怪我咯2017-04-18 10:56:37

    La corruption des fichiers n'a rien à voir avec le code. . . .

    répondre
    0
  • Annulerrépondre