Here you can find the source of padString(String source)
private static String padString(String source)
//package com.java2s; public class Main { private static String padString(String source) { char paddingChar = ' '; int size = 16; int x = source.length() % size; int padLength = size - x; for (int i = 0; i < padLength; i++) { source += paddingChar;/*from w w w.j a v a 2 s .c om*/ } return source; } }