2021-05-30

multiple images to one byte array? Array of byte arrays?

I have many images in a folder , I want to make one byte array for all of the images (array of byte arrays),but I only managed to make an array for one image .

    File file = new File("D:\\swim\\swim99.png");
    //init array with file length
    byte[] bytesArray = new byte[(int) file.length()]; 

    FileInputStream fis = new FileInputStream(file);
    fis.read(bytesArray); //read file into bytes[]
    fis.close();
    System.out.print(Arrays.toString(bytesArray));

So can I access multiple of images in a folder at once and get each one's byte array then put them into a 2D array of arrays array where the [Number of image[byte array image one]]?



from Recent Questions - Stack Overflow https://ift.tt/3fvUz9V
https://ift.tt/eA8V8J

No comments:

Post a Comment