Prepend zero to byte
<p>I'm reading file and I want to print byte value in 2 digits if it is less than 10 (example if byte=1 it should disply byte=01), I don't want to compare it like this:</p>

<pre><code>    if(byte&lt;10){
        stringBuffer buf= new stringBuffer();
        buf.append("0"+byte);
    }
</code></pre>

<p>is there any built in method to do this, just like the format function in vc++?</p>

<p>Thanks
gagana</p>
