|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.objsys.asn1j.runtime.Asn1Util
public class Asn1Util
This class contains some general purpose static utility functions.
Constructor Summary | |
---|---|
Asn1Util()
|
Method Summary | |
---|---|
static java.lang.String |
BCDToString(byte[] bcd)
Translates a BCD string to an ASCII string. |
static byte[] |
decodeBase64Array(byte[] srcArray)
Translates the specified Base64 array into byte array. |
static byte[] |
encodeBase64Array(byte[] srcArray)
Translates the specified byte array to Base64 byte array. |
static java.lang.String |
firstSortedElement(java.util.Vector v)
Returns the element of a Vector (that is assumed to contain strings) that is lexicographically the lowest element in the Vector. |
static int |
getBytesCount(long val)
Calculate the count of bytes necessary to represent a signed long value. |
static java.util.Vector |
getKeys(java.util.Hashtable h)
Returns a Vector containing the keys (assumed to be strings) of a passed Hashtable. |
static int |
getUlongBytesCount(long val)
Calculate the count of bytes necessary to represent an unsigned long value. |
static boolean |
isLetter(char c)
Determine if a specified character is a letter. |
static boolean |
isSpaceChar(char ch)
Determine if a specified character is a space. |
static boolean |
isWhitespace(char ch)
Determine if a specified character is whitespace. |
static double |
log2(double val)
Calculate the log base 2 of value |
static double |
pow(int base,
int exponent)
Raises an integer base to an integer power and returns the result as a double. |
static java.lang.String[] |
splitOnWhitespace(java.lang.String delimitedString)
Split a string around whitespace characters. |
static byte[] |
stringToBCD(java.lang.String str)
Translates an ASCII string to a BCD string. |
static byte[] |
stringToTBCD(java.lang.String str)
Translates an ASCII String to a TBCD String. |
static java.lang.String |
stripWhitespace(java.lang.String value)
Return the given string with all whitespace characters removed. |
static java.lang.String |
TBCDToString(byte[] bcd)
Translates a TBCD string to an ASCII string. |
static java.lang.String |
toHexString(byte b)
Convert a byte value to a hex string. |
static java.lang.String |
toHexString(byte[] b,
int offset,
int nbytes)
Convert a string of bytes into a hex string. |
static java.lang.StringBuffer |
toHexString(byte b,
java.lang.StringBuffer hexbuf)
Convert a byte value to a hex string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Asn1Util()
Method Detail |
---|
public static java.lang.String stripWhitespace(java.lang.String value)
value
-
public static java.lang.String toHexString(byte b)
public static java.lang.StringBuffer toHexString(byte b, java.lang.StringBuffer hexbuf)
public static java.lang.String toHexString(byte[] b, int offset, int nbytes)
public static int getBytesCount(long val)
val
- Integer value in which to count bytes.
public static double log2(double val)
val
- double value for which to count log(base2) val.
public static int getUlongBytesCount(long val)
val
- Integer value in which to count bytes.
public static byte[] encodeBase64Array(byte[] srcArray)
srcArray
- byte array to be translated
public static byte[] decodeBase64Array(byte[] srcArray)
srcArray
- Base64 byte array to be translated
public static byte[] stringToBCD(java.lang.String str) throws Asn1ValueParseException
str
- the source ASCII string
Asn1ValueParseException
- If invalid characters are in the source
string.public static java.lang.String BCDToString(byte[] bcd)
bcd
- the source BCD string
public static byte[] stringToTBCD(java.lang.String str) throws Asn1ValueParseException
str
- the source ASCII string
Asn1ValueParseException
- If invalid characters are in the source
string.public static java.lang.String TBCDToString(byte[] bcd)
bcd
- the source TBCD string
public static double pow(int base, int exponent)
base
- the base to be raised to the power.exponent
- the power to which base is to be raised.
public static boolean isWhitespace(char ch)
ch
- the character to test.
public static boolean isSpaceChar(char ch)
ch
- the character to test.
public static java.lang.String firstSortedElement(java.util.Vector v)
v
- the Vector to be examined.
public static java.util.Vector getKeys(java.util.Hashtable h)
h
- the Hashtable to be examined.
public static boolean isLetter(char c)
c
- The character to examine.
public static java.lang.String[] splitOnWhitespace(java.lang.String delimitedString)
delimitedString
- the whitespace-delimited string to parse.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |