iiitToolkit 1.0

de.iiit.util
Class StringUtil

java.lang.Object
  |
  +--de.iiit.util.StringUtil

public class StringUtil
extends Object

This class includes utility methods to use with String objects

Version:
$Revision: 1.9 $ $Date: 2003/03/12 21:06:38 $

Method Summary
static String byteArrayToHexString(byte[] b)
          Converts a byte array into a hex string
static byte[] hexStringToByteArray(String s)
          Converts a hex string into a byte array
static String md5Sum(byte[] source)
          Calculates a MD5-sum.
static String md5Sum(String source)
          Calculates a MD5-sum.
static String removeSpaces(String s)
          Remove all space characters (' ') from a given String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

removeSpaces

public static final String removeSpaces(String s)
Remove all space characters (' ') from a given String

Parameters:
s - The String object from which all spaces should be removed
Returns:
The String without spaces

byteArrayToHexString

public static final String byteArrayToHexString(byte[] b)
Converts a byte array into a hex string

Parameters:
b - The byte array to convert
Returns:
The string

hexStringToByteArray

public static final byte[] hexStringToByteArray(String s)
Converts a hex string into a byte array

Parameters:
s - The String to convert
Returns:
a byte array

md5Sum

public static String md5Sum(byte[] source)
                     throws NoSuchAlgorithmException
Calculates a MD5-sum.

Parameters:
source - The byte array to use for the calculations
Returns:
The calculated md5 sum as a hex string.
Throws:
NoSuchAlgorithmException - if the algorithm is not available in the caller's environment.

md5Sum

public static String md5Sum(String source)
                     throws NoSuchAlgorithmException
Calculates a MD5-sum.

Parameters:
source - The string to use for the calculations
Returns:
The calculated md5 sum as a hex string.
Throws:
NoSuchAlgorithmException - if the algorithm is not available in the caller's environment.

iiitToolkit 1.0

Copyright © 2002, 2003 ingeneurbuero fuer innovative informationstechnik, Dipl.-Ing. Joerg Beckmann, Dortmund, Germany. All Rights Reserved.
See Copyright statement