|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pixelmed.utils.HexDump
public class HexDump
Various static methods helpful for dumping decimal and hexadecimal values.
| Method Summary | |
|---|---|
static String |
byteArrayToHexString(byte[] b)
Create a continuous hex string representation of a byte array. |
static String |
byteArrayToHexString(byte[] b,
int offset,
int length)
Create a continuous hex string representation of a specified portion of a byte array. |
static String |
byteArrayToPrintableString(byte[] b)
Create a printable string representation of a specified portion of a byte array in the default character set. |
static String |
byteArrayToPrintableString(byte[] b,
int offset,
int length)
Create a printable string representation of a specified portion of a byte array in the default character set. |
static String |
byteToPaddedDecimalString(int i)
Convert an unsigned byte value to a decimal string of three characters with leading space padding. |
static String |
byteToPaddedHexString(int i)
Convert an unsigned byte value to a hexadecimal string of two characters with leading zero padding. |
static String |
byteToPaddedHexStringWith0x(int i)
Convert an unsigned byte value to a hexadecimal string of two characters with leading 0x and leading zero padding. |
static String |
dump(byte[] b)
Create a dump of the decimal offset, hexadecimal values and printable string values of a byte array. |
static String |
dump(byte[] b,
int lng)
Create a dump of the decimal offset, hexadecimal values and printable string values of a byte array. |
static String |
dump(byte[] b,
int offset,
int lng)
Create a dump of the decimal offset, hexadecimal values and printable string values of a byte array. |
static String |
dump(String s)
Create a dump of the decimal offset, hexadecimal values of the Unicode code points and printable string values of a String. |
static String |
dump(String s,
int lng)
Create a dump of the decimal offset, hexadecimal values of the Unicode code points and printable string values of a String. |
static String |
dump(String s,
int offset,
int lng)
Create a dump of the decimal offset, hexadecimal values of the Unicode code points and printable string values of a String. |
static String |
intToPaddedDecimalString(int i)
Convert an integer value to a decimal string of nine characters with leading space padding. |
static String |
intToPaddedHexString(int i)
Convert an integer value to a hexadecimal string of eight characters with leading zero padding. |
static String |
intToPaddedHexStringWith0x(int i)
Convert an integer value to a hexadecimal string of eight characters with leading 0x and leading zero padding. |
static boolean |
isPrintableCharacter(char c)
Test whether or not a character in the default character set is printable. |
static void |
main(String[] arg)
Unit test. |
static String |
shortToPaddedDecimalString(int i)
Convert an unsigned short value to a decimal string of six characters with leading space padding. |
static String |
shortToPaddedHexString(int i)
Convert an unsigned short value to a hexadecimal string of four characters with leading zero padding. |
static String |
shortToPaddedHexStringWith0x(int i)
Convert an unsigned short value to a hexadecimal string of four characters with leading 0x and leading zero padding. |
static String |
toPaddedDecimalString(int i,
char pad,
int length,
String prefix,
String suffix)
Convert an integer value to a decimal string, padding it to a specified length, and prepending a prefix and appending a suffix. |
static String |
toPaddedHexString(int i,
char pad,
int length,
String prefix,
String suffix)
Convert an integer value to a hexadecimal string, padding it to a specified length, and prepending a prefix and appending a suffix. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String toPaddedDecimalString(int i,
char pad,
int length,
String prefix,
String suffix)
Convert an integer value to a decimal string, padding it to a specified length, and prepending a prefix and appending a suffix.
i - the integer to dumppad - the pad character to append before the string value of the integer if necessarylength - the desired length of string converted integer and padding (not including the prefix or suffix)prefix - the string to prependsuffix - the string to append
public static String byteToPaddedDecimalString(int i)
Convert an unsigned byte value to a decimal string of three characters with leading space padding.
i - the unsigned byte value
public static String shortToPaddedDecimalString(int i)
Convert an unsigned short value to a decimal string of six characters with leading space padding.
i - the unsigned short value
public static String intToPaddedDecimalString(int i)
Convert an integer value to a decimal string of nine characters with leading space padding.
i - the integer value
public static String toPaddedHexString(int i,
char pad,
int length,
String prefix,
String suffix)
Convert an integer value to a hexadecimal string, padding it to a specified length, and prepending a prefix and appending a suffix.
i - the integer to dumppad - the pad character to append before the string value of the integer if necessarylength - the desired length of string converted integer and padding (not including the prefix or suffix)prefix - the string to prependsuffix - the string to append
public static String byteToPaddedHexString(int i)
Convert an unsigned byte value to a hexadecimal string of two characters with leading zero padding.
i - the unsigned byte value
public static String shortToPaddedHexString(int i)
Convert an unsigned short value to a hexadecimal string of four characters with leading zero padding.
i - the unsigned short value
public static String intToPaddedHexString(int i)
Convert an integer value to a hexadecimal string of eight characters with leading zero padding.
i - the integer value
public static String byteToPaddedHexStringWith0x(int i)
Convert an unsigned byte value to a hexadecimal string of two characters with leading 0x and leading zero padding.
i - the unsigned byte value
public static String shortToPaddedHexStringWith0x(int i)
Convert an unsigned short value to a hexadecimal string of four characters with leading 0x and leading zero padding.
i - the unsigned short value
public static String intToPaddedHexStringWith0x(int i)
Convert an integer value to a hexadecimal string of eight characters with leading 0x and leading zero padding.
i - the integer value
public static boolean isPrintableCharacter(char c)
Test whether or not a character in the default character set is printable.
c - character to test
public static String byteArrayToPrintableString(byte[] b,
int offset,
int length)
Create a printable string representation of a specified portion of a byte array in the default character set.
Unprintable characters are represented by a period ('.') character.
b - the byte arrayoffset - the start of the bytes to be extractedlength - the number of bytes to be extracted
public static String byteArrayToPrintableString(byte[] b)
Create a printable string representation of a specified portion of a byte array in the default character set.
Unprintable characters are represented by a period ('.') character.
b - the byte array
public static String byteArrayToHexString(byte[] b,
int offset,
int length)
Create a continuous hex string representation of a specified portion of a byte array.
b - the byte arrayoffset - the start of the bytes to be extractedlength - the number of bytes to be extracted
public static String byteArrayToHexString(byte[] b)
Create a continuous hex string representation of a byte array.
b - the byte array
public static String dump(byte[] b,
int offset,
int lng)
Create a dump of the decimal offset, hexadecimal values and printable string values of a byte array.
The result is similar to a dump produced by the unix od or MacOS X 'hexdump -C' commands.
b - the byte array to be dumpedoffset - the offset into the buffer to be dumpedlng - the number of bytes to be dumped
public static String dump(byte[] b,
int lng)
Create a dump of the decimal offset, hexadecimal values and printable string values of a byte array.
The result is similar to a dump produced by the unix od or MacOS X 'hexdump -C' commands.
b - the byte array to be dumpedlng - the number of bytes to be dumped
public static String dump(byte[] b)
Create a dump of the decimal offset, hexadecimal values and printable string values of a byte array.
The result is similar to a dump produced by the unix od or MacOS X 'hexdump -C' commands.
b - the byte array to be dumped in its entirety
public static String dump(String s,
int offset,
int lng)
Create a dump of the decimal offset, hexadecimal values of the Unicode code points and printable string values of a String.
s - the String to be dumpedoffset - the offset into the String to be dumpedlng - the number of characters to be dumped
public static String dump(String s,
int lng)
Create a dump of the decimal offset, hexadecimal values of the Unicode code points and printable string values of a String.
s - the String to be dumpedlng - the number of characters to be dumped
public static String dump(String s)
Create a dump of the decimal offset, hexadecimal values of the Unicode code points and printable string values of a String.
s - the String to be dumped dumped in its entirety
public static void main(String[] arg)
Unit test.
arg - ignored
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||