public static StringBuilder formatTo(StringBuilder buf,int[] d,String sep){
  if (d == null) {
    return buf.append("null");
  }
  if (d.length == 0) {
    return buf;
  }
  buf.append(d[0]);
  for (int i=1; i < d.length; i++) {
    buf.append(sep);
    buf.append(d[i]);
  }
  return buf;
}

public static StringBuilder formatTo ( StringBuilder buf , int [ ] d , String sep ) { if ( d == null ) { return buf . append ( "null" ) ; } if ( d . length == 0 ) { return buf ; } buf . append ( d [ 0 ] ) ; for ( int i = 1 ; i < d . length ; i ++ ) { buf . append ( sep ) ; buf . append ( d [ i ] ) ; } return buf ; }
formats the int array d .
