protected String toPaddedString(String s, int i) {
        StringBuilder sb = new StringBuilder(i);
        if (s != null)
            sb.append(s);
        sb.setLength(i);
        return sb.toString();
    }