cfam-matrix Prime Sieves (java code): reporting/formatting utility


import java.io.*;

// __
class SUtils24{
private final byte[] _bHEX_TABLE = "0123456789abcdef".getBytes();
// __
SUtils24(){}

// __
public String getAsHex(byte[] bAr) throws UnsupportedEncodingException{
byte[] bHex = new byte[2 * bAr.length];
// __
for(int i = 0; (i >> 4];
bHex[2*i + 1] = _bHEX_TABLE[v & 0xF];
}
// __
return new String(bHex, "ASCII");
}

// __ @! comp.lang.java.help: "how to print integer with alignment" Java doesn't? Does jakarta.commons?
public String padString(int iCs, String aIS, int iSpc){
String aFS = null; // formatted String
int iISL = aIS.length();
int iPadL = (iSpc - iISL);
if(iPadL > 0){
StringBuffer aB = new StringBuffer();
for(int i = 0; i 0)
else{ aFS = aIS; }
// __
return(aFS);
}
}


%d bloggers like this: