Read byte array from file

void Impuls(File selection) {
  if (selection == null) {
    println("Window was closed or the user hit cancel.");
  } else {
    println("User selected " + selection.getAbsolutePath());
    String[] lines = loadStrings(selection.getAbsolutePath());
    inputPULI.setValue(lines.length); // ПРОЧИТАЛИ СТРОКИ
    
        String[] items = lines[0].split(" ");
        String[] items1 = lines[1].split(" ");
        String[] items2 = lines[2].split(" ");
        String[] items3 = lines[3].split(" ");
        String[] items4 = lines[4].split(" ");
            println(items[0]);
            serialPort.write(items[0]);
            println(items[1]);
            serialPort.write(items[1]);
            println(items1[0]);
            serialPort.write(items1[0]);
            println(items1[1]);
            serialPort.write(items1[1]);
            println(items2[0]);
            serialPort.write(items2[0]);
            println(items2[1]);
            serialPort.write(items2[1]);
            println(items3[0]);
            serialPort.write(items3[0]);
            println(items3[1]);
            serialPort.write(items3[1]);
            println(items4[0]);
            serialPort.write(items4[0]);
            println(items4[1]);
            serialPort.write(items4[1]);
           {
           writeuploadimpuls();
           }      
          }
}

Run File dodo.pde
See the screen “123.png” The screenshot shows an arrow where to open the file!

When reading the file “Impuls.txt” through the download button, the lines are read (number of pulses of bullets)
Through a space in the console, for your own understanding, the first 5 pulses with numbering are displayed in a column.
Then these impulses 5 pieces (so far) are written to the port in the form of characters in the “hex” display mode.
Code section GUI tab - lines 356-396.
Line 393 The button handler is associated with the Protokol tab lines 41-54.
Now the characters of the string are sent to the port, they will be hidden:
1
8500
2
8470
3
8450
4
8440
5
8435
How to send numbers without numbering 85008470845084408435???
8500 is 4 bytes
But the whole task is reduced to one, you need to work with bytes, not strings, that is:

  1. Read byte array from file (reading bytes from a file) and send it, then to the W25Q memory.
  2. There is loadstrings, it gives a string array, but there is a type of such readbytes, I don’t know the name, it gives a byte array. It is necessary to look in the processing documentation.

Full project in the archive:
https://drive.google.com/file/d/1KzsV4J_czBPj80Jm0PQnzeRVq3h7BObB/view?usp=drivesdk