com.informix.util

## Class stringUtil

- java.lang.Object
- - com.informix.util.stringUtil

    public class stringUtil
    extends java.lang.Object

### Field Summary

Fields
`static java.lang.String` `DEFAULT_ENCODING`

### Constructor Summary

Constructors
Constructor and Description
`stringUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static java.lang.String` `fixLength(java.lang.String x, int len, char pad)`
`static byte[]` `fromHexString(java.lang.String str)` fromHexString(String str) throws NumberFormatException Converts a String consisting only of hexadecimal (base 16) digits to a byte array.
`static byte[]` `getBytes(java.lang.String str, IfxConnection conn)`
`static byte[]` `getBytes(java.lang.String str, java.lang.String encoding)`
`static java.lang.String` `getString(byte[] encoded, int offset, int length, java.lang.String encoding)`
`static java.lang.String` `getString(byte[] encoded, java.lang.String encoding)`
`static boolean` `isANum(java.lang.String s)` Support function that checks to see if a given string is a valid integer.
`static java.lang.String` `replaceEscapeCharacters(java.lang.String escapeString)`
`static int` `stringToInt(java.lang.String str)` Convert a string to int, return the int.
`static java.lang.String` `toHexString(byte[] byteBuf)` toHexString(byte[] buf) Converts a byte array to a hexadecimal (base 16) character string representation.
`static java.lang.String` `trimTrailings(java.lang.String s)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_ENCODING

    public static final java.lang.String DEFAULT_ENCODING

See Also:
  Constant Field Values

### Constructor Detail

#### stringUtil

    public stringUtil()

### Method Detail

#### stringToInt

    public static int stringToInt(java.lang.String str)

Convert a string to int, return the int. Return 0 if any problems occur

Parameters:
  `a` - string representation of a number
Returns:
  an int

#### toHexString

    public static java.lang.String toHexString(byte[] byteBuf)

toHexString(byte[] buf) Converts a byte array to a hexadecimal (base 16) character string representation.

Parameters:
  `byteBuf` - - a byte array
Returns:
  the string representation of the byte[] parameter in hexadecimal (base 16).

#### fromHexString

    public static byte[] fromHexString(java.lang.String str)
                                throws java.lang.NumberFormatException

fromHexString(String str) throws NumberFormatException Converts a String consisting only of hexadecimal (base 16) digits to a byte array.

Parameters:
  `str` - - a String containing only hexadecimal digits
Returns:
  the byte[] represented by this String.
Throws:
  `java.lang.NumberFormatException`

#### isANum

    public static boolean isANum(java.lang.String s)

Support function that checks to see if a given string is a valid integer. This is used to verify that individual fields of the ip address and port number are valid numbers.

Parameters:
  `s` - - string representation of a number connect open.
Returns:
  true/false

#### fixLength

    public static java.lang.String fixLength(java.lang.String x,
                                             int len,
                                             char pad)

#### trimTrailings

    public static java.lang.String trimTrailings(java.lang.String s)

#### getString

    public static java.lang.String getString(byte[] encoded,
                                             java.lang.String encoding)
                                      throws java.io.IOException

Throws:
  `java.io.IOException`

#### getString

    public static java.lang.String getString(byte[] encoded,
                                             int offset,
                                             int length,
                                             java.lang.String encoding)
                                      throws java.io.IOException

Throws:
  `java.io.IOException`

#### getBytes

    public static byte[] getBytes(java.lang.String str,
                                  java.lang.String encoding)
                           throws java.io.IOException

Throws:
  `java.io.IOException`

#### getBytes

    public static byte[] getBytes(java.lang.String str,
                                  IfxConnection conn)
                           throws java.io.IOException

Throws:
  `java.io.IOException`

#### replaceEscapeCharacters

    public static java.lang.String replaceEscapeCharacters(java.lang.String escapeString)