public int format(String val,byte[] array,int off,int len){
  if (val == null) {
    for (int i=0; i < len; i++) {
      array[off + i]=(byte)' ';
    }
    return off + len;
  }
  int slen=val.length();
  if (slen > len || slen > array.length - off) {
    val=val.substring(0,len);
    slen=len;
  }
  System.arraycopy(AsciiFuncs.getBytes(val),0,array,off,slen);
  return off + slen;
}

public int format ( String val , byte [ ] array , int off , int len ) { if ( val == null ) { for ( int i = 0 ; i < len ; i ++ ) { array [ off + i ] = ( byte ) ' ' ; } return off + len ; } int slen = val . length ( ) ; if ( slen > len || slen > array . length - off ) { val = val . substring ( 0 , len ) ; slen = len ; } System . arraycopy ( AsciiFuncs . getBytes ( val ) , 0 , array , off , slen ) ; return off + slen ; }
insert a string into an existing character array . if the string is longer than len , then only the the initial len characters will be inserted .
