|
SOA © 2004 SoS Group All Rights Reserved |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsos.koa.Hex
Some static helper methods for dealing with hexadecimal notation.
| Constructor Summary | |
private |
Hex()
This private constructor makes it impossible to create instances of this class. |
| Method Summary | |
static java.lang.String |
bytesToHexString(byte[] text)
Converts a byte array to capitalized hexadecimal text. |
static java.lang.String |
bytesToHexString(byte[] text,
int offset,
int length)
Converts part of a byte array to capitalized hexadecimal text. |
static java.lang.String |
byteToHexString(int n)
Converts the byte n to capitalized hexadecimal text. |
private static int |
hexCharToInt(char c)
Interprets the character c as hexadecimal
digit. |
static byte[] |
hexStringToBytes(java.lang.String text)
Converts the hexadecimal string in text to
a byte array. |
static short |
hexStringToShort(java.lang.String text)
|
static java.lang.String |
intToHexString(int n)
Converts the integer n to capitalized hexadecimal text. |
static java.lang.String |
shortToHexString(int n)
Converts the short n to capitalized hexadecimal text. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
private Hex()
| Method Detail |
public static java.lang.String byteToHexString(int n)
n to capitalized hexadecimal text.
n - The byte to convert.
n.public static java.lang.String shortToHexString(int n)
n to capitalized hexadecimal text.
n - The short to convert.
n.public static java.lang.String intToHexString(int n)
n to capitalized hexadecimal text.
n - The integer to convert.
n.public static java.lang.String bytesToHexString(byte[] text)
text - The byte array to convert.
text.
public static java.lang.String bytesToHexString(byte[] text,
int offset,
int length)
offset until (excluding)
index offset+length.
text - The byte array to convert.offset - Where to start.length - How many bytes to convert.
text.
public static short hexStringToShort(java.lang.String text)
throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static byte[] hexStringToBytes(java.lang.String text)
throws java.lang.NumberFormatException
text to
a byte array. If text has an odd number of
characters, a 0 is inserted at the beginning.
text - The string to convert.
text.
java.lang.NumberFormatException
private static int hexCharToInt(char c)
throws java.lang.NumberFormatException
c as hexadecimal
digit.
c - A character from
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
c.
java.lang.NumberFormatException
|
SOA © 2004 SoS Group All Rights Reserved |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||