Answer the question
In order to leave comments, you need to log in
How to count a file in Java?
Read file from folder (other) and do createImageInputStream
File file = new File("/home/nursultan/MNT_FILES/4you/Кв листы/Квартиры/Бизнес/1 очередь/Квартиры/1.jpg");
BufferedImage img = ImageIO.read(file);
ImageInputStream input = ImageIO.createImageInputStream(img);
input получаю null
Answer the question
In order to leave comments, you need to log in
Try to write not a relative path to the file, but an absolute
one. If OS Windows, the path to the file can be copied like this: hold down shift and right-click on the file, the path will be copied as text in the list
If you need exactly ImageInputStream, then you can, for example, like this:
FileInputStream fileInputStream = new FileInputStream("/home/nursultan/MNT_FILES/4you/Кв листы/Квартиры/Бизнес/1 очередь/Квартиры/1.jpg");
ImageInputStream imageInputStream = ImageIO.createImageInputStream(fileInputStream);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question