org.tinyradius.util
Class RadiusUtil

java.lang.Object
  extended by org.tinyradius.util.RadiusUtil

public class RadiusUtil
extends java.lang.Object

This class contains miscellaneous static utility functions.


Constructor Summary
RadiusUtil()
           
 
Method Summary
static java.lang.String getHexString(byte[] data)
          Returns the byte array as a hex string in the format "0x1234".
static java.lang.String getStringFromUtf8(byte[] utf8)
          Creates a string from the passed byte array containing the string in UTF-8 representation.
static byte[] getUtf8Bytes(java.lang.String str)
          Returns the passed string as a byte array containing the string in UTF-8 representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadiusUtil

public RadiusUtil()
Method Detail

getUtf8Bytes

public static byte[] getUtf8Bytes(java.lang.String str)
Returns the passed string as a byte array containing the string in UTF-8 representation.

Parameters:
str - Java string
Returns:
UTF-8 byte array

getStringFromUtf8

public static java.lang.String getStringFromUtf8(byte[] utf8)
Creates a string from the passed byte array containing the string in UTF-8 representation.

Parameters:
utf8 - UTF-8 byte array
Returns:
Java string

getHexString

public static java.lang.String getHexString(byte[] data)
Returns the byte array as a hex string in the format "0x1234".

Parameters:
data - byte array
Returns:
hex string