(int s)
| 31 | public SB p( boolean s) { _sb.append(s); return this; } |
| 32 | // 4 hex digits |
| 33 | public SB hex4(int s) { |
| 34 | assert (s>>4*4)==0; // Fits in 16 bits |
| 35 | for( int i=0; i<4; i++ ) { |
| 36 | int digit = (s>>((3-i)*4)) & 0xf; |
| 37 | _sb.append((char)((digit <= 9 ? '0' : ('A'-10))+digit)); |
| 38 | } |
| 39 | return this; |
| 40 | } |
| 41 | // Fixed width field |
| 42 | public SB fix( int sz, String s ) { |
| 43 | assert sz >=0; |