com.novell.admin.ns
Class NSUtil
java.lang.Object
|
+--com.novell.admin.ns.NSUtil
- public class NSUtil
- extends java.lang.Object
This is a Util class with static helper functions.
|
Method Summary |
static int |
byteToDecimal(byte b)
Converts a byte to its positive decimal value. |
static void |
copyIntoArray(java.util.Hashtable hashtable,
java.lang.Object[] anArray)
Copies the contents of a hash table into an array. |
static byte[] |
hexStringToByteArray(java.lang.String str)
Converts a string to a byte array. |
static void |
main(java.lang.String[] st)
|
static byte[] |
reverseBytes(byte[] bytes)
Reverses a byte array. |
static java.lang.String |
toHexString(byte[] bytes)
Converts a byte array to a hex string. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
NSUtil
public NSUtil()
copyIntoArray
public static void copyIntoArray(java.util.Hashtable hashtable,
java.lang.Object[] anArray)
- Copies the contents of a hash table into an array.
- Parameters:
hashtable - The hash table of source objects.anArray - The destination array.
toHexString
public static java.lang.String toHexString(byte[] bytes)
- Converts a byte array to a hex string.
- Parameters:
bytes - The byte array.- Returns:
- java.util.String A String representing the hex value of the array.
byteToDecimal
public static int byteToDecimal(byte b)
- Converts a byte to its positive decimal value.
- Parameters:
b - The byte to convert.- Returns:
- A positive int representing the byte argument.
hexStringToByteArray
public static byte[] hexStringToByteArray(java.lang.String str)
throws java.lang.NumberFormatException
- Converts a string to a byte array.
The string is parsed so that each character represents a single nibble
in the byte array. Valid characters are [0-9a-fA-F].
- Parameters:
str - The string which being parsed.- Returns:
- The new byte array.
reverseBytes
public static byte[] reverseBytes(byte[] bytes)
- Reverses a byte array.
- Parameters:
bytes - The byte array to reverse.- Returns:
- The new byte array.
main
public static void main(java.lang.String[] st)
API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.