code: @NonNull
      private static byte[] download(String url) throws IOException {
          InputStream is = null;
          ByteArrayOutputStream os = null;
  
          try {
  
              final URL u = new URL(url);
              final URLConnection connection = u.openConnection();
              connection.connect();
  
              is = connection.getInputStream();
              os = new ByteArrayOutputStream();
  
              final byte[] buffer = new byte[4096];
              int read;
  
              while (true) {
                  read = is.read(buffer, 0, buffer.length);
                  if (read == -1) {
                      break;
                  }
                  os.write(buffer, 0, read);
              }
  
              return os.toByteArray();
          } finally {
              if (is != null) {
                  try {
                      is.close();
                  } catch (IOException ignored) {
                  }
              }
              if (os != null) {
                  try {
                      os.close();
                  } catch (IOException ignored) {
                  }
              }
          }
      }
docs: Downloads data to buffer
  
  @param url Data location
  @return downloaded data or null if error occurred