org.histpop.ohpr.util
Class StringUtils

java.lang.Object
  extended by org.histpop.ohpr.util.StringUtils

public class StringUtils
extends java.lang.Object


Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.String bytesToString(byte[] bytes, int hibyte)
          A substitute function for the now deprecated new String( byte[] bytes, int hibyte )
static int charToInt(char ch)
          Convert a 16-bit (for example UNICODE) character into an unsigned integer value
static byte[] compress(byte[] b)
          Compress a byte array using GZIP.
static java.lang.String encode(java.lang.String str)
          Convert a given string into a URL-encoded string for UTF-8
static java.lang.String replaceAll(java.lang.String target, java.lang.String oldPattern, java.lang.String newPattern)
           
static java.lang.String replaceFirst(java.lang.String target, java.lang.String oldPattern, java.lang.String newPattern)
           
static boolean textHasContent(java.lang.String text)
           
 
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

replaceAll

public static java.lang.String replaceAll(java.lang.String target,
                                          java.lang.String oldPattern,
                                          java.lang.String newPattern)

replaceFirst

public static java.lang.String replaceFirst(java.lang.String target,
                                            java.lang.String oldPattern,
                                            java.lang.String newPattern)

encode

public static java.lang.String encode(java.lang.String str)
Convert a given string into a URL-encoded string for UTF-8


textHasContent

public static boolean textHasContent(java.lang.String text)

bytesToString

public static java.lang.String bytesToString(byte[] bytes,
                                             int hibyte)
A substitute function for the now deprecated new String( byte[] bytes, int hibyte )


charToInt

public static int charToInt(char ch)
Convert a 16-bit (for example UNICODE) character into an unsigned integer value


compress

public static byte[] compress(byte[] b)
                       throws java.io.IOException
Compress a byte array using GZIP.

Parameters:
b - the input string
Returns:
the equivalent GZIP compressed byte array
Throws:
java.io.IOException