static String[] SPACES = {" ", " ", " ", " ", //1,2,4,8 spaces
" ", // 16 spaces
" " }; // 32 spaces
/**
Fast space padding method.
*/
public
void spacePad(StringBuffer sbuf, int length) {
while(length >= 32) {
sbuf.append(SPACES[5]);
length -= 32;
}
for(int i = 4; i >= 0; i--) {
if((length & (1<<i)) != 0) {
sbuf.append(SPACES[i]);
}
}
}