TestUtilspublic class TestUtils extends Object
Constructors Summary |
---|
private TestUtils()No need to instantiate
|
Methods Summary |
---|
public static void | printAsHex(int perLine, java.lang.String prefix, java.lang.String delimiter, byte[] data)Prints byte array data as hex to the
System.out in the customizable form.
for (int i=0; i<data.length; i++) {
String tail = Integer.toHexString(0x000000ff & data[i]);
if (tail.length() == 1) {
tail = "0" + tail;
}
System.out.print(prefix + "0x" + tail + delimiter);
if (((i+1)%perLine) == 0) {
System.out.println("");
}
}
System.out.println("");
| public static void | setSystemProperty(java.lang.String key, java.lang.String value)Sets system property
Properties properties = System.getProperties();
if (value == null) {
properties.remove(key);
} else {
properties.setProperty(key, value);
}
System.setProperties(properties);
|
|