private static final String truncateNameTo45Bytes(String name){
  String ret=name;
  if (ret.getBytes().length > MAX_BYTES) {
    ret=name.substring(0,MAX_BYTES);
  }
  if (ret.getBytes().length > MAX_BYTES) {
    ret=name.substring(0,MAX_BYTES / 2);
  }
  return ret;
}

private static final String truncateNameTo45Bytes ( String name ) { String ret = name ; if ( ret . getBytes ( ) . length > MAX_BYTES ) { ret = name . substring ( 0 , MAX_BYTES ) ; } if ( ret . getBytes ( ) . length > MAX_BYTES ) { ret = name . substring ( 0 , MAX_BYTES / 2 ) ; } return ret ; }
truncates name to fit in 45 bytes
