static ArrayList<String> loadImagePad(File file,char padChar) throws FileNotFoundException, RuntimeException {
  if (file == null)   return null;
  Scanner sc;
  sc=new Scanner(file);
  ArrayList<String> rows=new ArrayList<String>();
  String s=sc.nextLine();
  int len=s.length();
  rows.add(s);
  while (sc.hasNext()) {
    s=sc.nextLine();
    if (s.length() != len) {
      StringBuilder sb=new StringBuilder(s);
      for (int i=0; i < len - s.length(); i++) {
        sb.append(padChar);
      }
      s=sb.toString();
    }
    rows.add(s);
  }
  sc.close();
  return rows;
}

static ArrayList < String > loadImagePad ( File file , char padChar ) throws FileNotFoundException , RuntimeException { if ( file == null ) return null ; Scanner sc ; sc = new Scanner ( file ) ; ArrayList < String > rows = new ArrayList < String > ( ) ; String s = sc . nextLine ( ) ; int len = s . length ( ) ; rows . add ( s ) ; while ( sc . hasNext ( ) ) { s = sc . nextLine ( ) ; if ( s . length ( ) != len ) { StringBuilder sb = new StringBuilder ( s ) ; for ( int i = 0 ; i < len - s . length ( ) ; i ++ ) { sb . append ( padChar ) ; } s = sb . toString ( ) ; } rows . add ( s ) ; } sc . close ( ) ; return rows ; }
helper function to load up images , and pad too - short lines with given padcharacter .
