docs: @NotNull
      public static byte[] readBytes(@NotNull File file) throws IOException
      {
          int length = (int)file.length();
          // should only be zero if loading from a network or similar
          assert (length != 0);
          byte[] bytes = new byte[length];
  
          int totalBytesRead = 0;
          FileInputStream inputStream = null;
          try {
              inputStream = new FileInputStream(file);
              while (totalBytesRead != length) {
                  int bytesRead = inputStream.read(bytes, totalBytesRead, length - totalBytesRead);
                  if (bytesRead == -1) {
                      break;
                  }
                  totalBytesRead += bytesRead;
              }
          } finally {
              if (inputStream != null) {
                  inputStream.close();
              }
          }
  
          return bytes;
      }