code: protected static String formatMDLInt(int x, int n) {
          char[] buf = new char[n];
          Arrays.fill(buf, ' ');
          String val = Integer.toString(x);
          if (val.length() > n)
              val = "0";
          int off = n - val.length();
          for (int i = 0; i < val.length(); i++)
              buf[off+i] = val.charAt(i);
          return new String(buf);
      }
docs: Formats an integer to fit into the connection table and changes it
  to a String.
  
  @param x The int to be formated
  @param n Length of the String
  @return The String to be written into the connectiontable