public class StringUtil extends Object
Modifier and Type | Method and Description |
---|---|
static StringBuffer |
append(StringBuffer buf,
byte[] o)
Appends hexBytes to a StringBuffer.
|
static boolean |
append(StringBuffer buf,
String description,
boolean flag,
boolean comma)
Appends description to a StringBuffer if a flag is set, optionally preceded by a comma.
|
static boolean |
append(StringBuffer buf,
String name,
int value,
boolean comma)
Appends name=value to a StringBuffer, optionally preceded by a comma.
|
static boolean |
append(StringBuffer buf,
String name,
Object[] o,
boolean comma)
Appends name=[values] to a StringBuffer, optionally preceded by a comma.
|
static boolean |
append(StringBuffer buf,
String name,
Object o,
boolean comma)
Appends name=value to a StringBuffer, optionally preceded by a comma.
|
static StringBuilder |
append(StringBuilder buf,
byte[] o)
Appends hexBytes to a StringBuilder.
|
static StringBuilder |
appendASN1OctetString(StringBuilder buf,
byte[] bs)
Appends an octet string to a StringBuilder using standard ASN.1 mark-up.
|
static boolean |
appendDecimal(StringBuffer buf,
String name,
byte[] o,
boolean comma)
Appends name=[decimalBytes] to a StringBuffer, optionally preceded by a comma.
|
static boolean |
appendHex(StringBuffer buf,
String name,
byte[] o,
boolean comma)
Appends name=[hexBytes] to a StringBuffer, optionally preceded by a comma.
|
static boolean |
appendHex(StringBuilder buf,
String name,
byte[] o,
boolean comma)
Appends name=[hexBytes] to a StringBuilder, optionally preceded by a comma.
|
static void |
appendSpaces(StringBuilder buf,
int length)
Appends the given number of space characters to the given StringBuilder.
|
static char |
getHexDigit(int v)
Converts a byte to a char containing its hexadecimal value.
|
static String |
spaces(int length)
Returns a String containing the given number of space characters.
|
static String |
toHexString(byte[] o)
Converts a byte array to a String containing the hexadecimal values of the bytes.
|
public static boolean append(StringBuffer buf, String name, Object o, boolean comma)
buf
- StringBuffername
- Stringo
- object valuecomma
- whether to precede with a commapublic static boolean append(StringBuffer buf, String name, Object[] o, boolean comma)
buf
- StringBuffername
- Stringo
- object valuescomma
- whether to precede with a commapublic static boolean append(StringBuffer buf, String name, int value, boolean comma)
buf
- StringBuffername
- Stringvalue
- integer valuecomma
- whether to precede with a commapublic static boolean append(StringBuffer buf, String description, boolean flag, boolean comma)
buf
- StringBufferdescription
- Stringflag
- whether to append descriptioncomma
- whether to precede with a commapublic static boolean appendDecimal(StringBuffer buf, String name, byte[] o, boolean comma)
buf
- StringBuffername
- Stringo
- byte arraycomma
- whether to precede with a commapublic static boolean appendHex(StringBuffer buf, String name, byte[] o, boolean comma)
buf
- StringBuffername
- Stringo
- byte arraycomma
- whether to precede with a commapublic static boolean appendHex(StringBuilder buf, String name, byte[] o, boolean comma)
buf
- StringBuildername
- Stringo
- byte arraycomma
- whether to precede with a commapublic static StringBuffer append(StringBuffer buf, byte[] o)
buf
- StringBuffero
- byte arraypublic static StringBuilder append(StringBuilder buf, byte[] o)
buf
- StringBuildero
- byte arraypublic static String toHexString(byte[] o)
o
- byte arraypublic static char getHexDigit(int v)
v
- bytepublic static StringBuilder appendASN1OctetString(StringBuilder buf, byte[] bs)
buf
- StringBuilder to append tobs
- byte array representing octet stringpublic static final void appendSpaces(StringBuilder buf, int length)
NullPointerException
- if buf is nullIllegalArgumentException
- if length is less than zeropublic static final String spaces(int length)
IllegalArgumentException
- if length is less than zero