com.lti.utils
Class StringUtils

java.lang.Object
  extended by com.lti.utils.StringUtils

public final class StringUtils
extends java.lang.Object

String utilties. TODO: move to src.utils/com.lti.utils.

Author:
Ken Larson

Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.String byteArrayToBase64String(byte[] value)
           
static java.lang.String byteArrayToHexString(byte[] array)
           
static java.lang.String byteArrayToHexString(byte[] array, int len)
           
static java.lang.String byteArrayToHexString(byte[] array, int len, int offset)
           
static java.lang.String byteToHexString_ZeroPad(byte b)
           
static java.lang.String dump(byte[] bytes, int offset, int byteslen)
          Dump to string using a debugger-like format - both hex and ascii.
static byte hexStringToByte(java.lang.String s)
           
static byte[] hexStringToByteArray(java.lang.String s)
           
static java.lang.String replaceSpecialUrlChars(java.lang.String raw)
           
static java.lang.String replaceSpecialUrlChars(java.lang.String raw, boolean isPath)
           
static java.lang.String restoreSpecialURLChars(java.lang.String cooked)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

byteToHexString_ZeroPad

public static java.lang.String byteToHexString_ZeroPad(byte b)

replaceSpecialUrlChars

public static java.lang.String replaceSpecialUrlChars(java.lang.String raw)

replaceSpecialUrlChars

public static java.lang.String replaceSpecialUrlChars(java.lang.String raw,
                                                      boolean isPath)

restoreSpecialURLChars

public static java.lang.String restoreSpecialURLChars(java.lang.String cooked)

dump

public static java.lang.String dump(byte[] bytes,
                                    int offset,
                                    int byteslen)
Dump to string using a debugger-like format - both hex and ascii. Bytes dumped will be byteslen - offset.


byteArrayToHexString

public static java.lang.String byteArrayToHexString(byte[] array)

byteArrayToHexString

public static java.lang.String byteArrayToHexString(byte[] array,
                                                    int len)

byteArrayToHexString

public static java.lang.String byteArrayToHexString(byte[] array,
                                                    int len,
                                                    int offset)

hexStringToByteArray

public static byte[] hexStringToByteArray(java.lang.String s)
Throws:
java.lang.NumberFormatException

hexStringToByte

public static byte hexStringToByte(java.lang.String s)
Throws:
java.lang.NumberFormatException

byteArrayToBase64String

public static java.lang.String byteArrayToBase64String(byte[] value)