|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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 int |
getBytesCount(long val)
Calculate the count of bytes necessary to represent a signed long value. |
static int |
getUlongBytesCount(long val)
Calculate the count of bytes necessary to represent an unsigned long value. |
static double |
log2(double val)
Calculate the log base 2 of value |
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 |
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 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 lag(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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |