Or make a separate method? Alot easier...
This particular format is also pretty easy to replicate without JDK 5:
however I like to encourage people to learn to use String.format() (and similar methods added to PrintWriter and other classes). They give you a lot more options for formatting things.
[ January 29, 2007: Message edited by: Jim Yingst ]
For example, let's say we want to determine the pattern for 15 in Excess 128 notation. The decimal number would be 128 + 15, or 143. Therefore, the bit pattern would be 10001111. Likewise, -15 would be 128 - 15, or 113. Therefore, the bit pattern would be 01110001.