org.apache.commons.ssl

## Class Util

- java.lang.Object
- - org.apache.commons.ssl.Util

    public class Util
    extends java.lang.Object

Since:
  28-Feb-2006
Author:
  Credit Union Central of British Columbia, www.cucbc.com, juliusdavies@cucbc.com

### Field Summary

Fields
`static int` `LAST_READ_KEY`
`static int` `SIZE_KEY`

### Constructor Summary

Constructors
Constructor and Description
`Util()`

### Method Summary

Methods
`static java.lang.String` `cipherToAuthType(java.lang.String cipher)`
`static int[]` `fill(byte[] buf, int offset, java.io.ByteArrayInputStream in)`
`static int[]` `fill(byte[] buf, int offset, java.io.InputStream in)`
`static boolean` `isWhiteSpace(char c)`
`static boolean` `isYes(java.lang.String yesString)`
`static void` `main(java.lang.String[] args)`
`static java.lang.String` `pad(java.lang.String s, int length, boolean left)`
`static java.util.Map` `parseArgs(java.lang.String[] cargs)`
`static void` `pipeStream(java.io.InputStream in, java.io.OutputStream out)`
`static void` `pipeStream(java.io.InputStream in, java.io.OutputStream out, boolean autoClose)`
`static byte[]` `resizeArray(byte[] bytes)`
`static byte[]` `streamToBytes(java.io.ByteArrayInputStream in)`
`static byte[]` `streamToBytes(java.io.ByteArrayInputStream in, int maxLength)`
`static byte[]` `streamToBytes(java.io.InputStream in)`
`static byte[]` `streamToBytes(java.io.InputStream in, int maxLength)`
`static HostPort` `toAddress(java.lang.String target, int defaultPort)`
`static java.net.InetAddress` `toInetAddress(java.lang.String s)` Utility method to make sure IP-literals don't trigger reverse-DNS lookups.
`static java.lang.String` `trim(java.lang.String s)`

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

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

### Field Detail

#### SIZE_KEY

    public static final int SIZE_KEY

See Also:
  Constant Field Values

#### LAST_READ_KEY

    public static final int LAST_READ_KEY

See Also:
  Constant Field Values

### Constructor Detail

#### Util

    public Util()

### Method Detail

#### isYes

    public static boolean isYes(java.lang.String yesString)

#### trim

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

#### isWhiteSpace

    public static boolean isWhiteSpace(char c)

#### pipeStream

    public static void pipeStream(java.io.InputStream in,
                  java.io.OutputStream out)
                           throws java.io.IOException

Throws:
  `java.io.IOException`

#### pipeStream

    public static void pipeStream(java.io.InputStream in,
                  java.io.OutputStream out,
                  boolean autoClose)
                           throws java.io.IOException

Throws:
  `java.io.IOException`

#### streamToBytes

    public static byte[] streamToBytes(java.io.ByteArrayInputStream in,
                       int maxLength)

#### streamToBytes

    public static byte[] streamToBytes(java.io.InputStream in,
                       int maxLength)
                                throws java.io.IOException

Throws:
  `java.io.IOException`

#### streamToBytes

    public static byte[] streamToBytes(java.io.InputStream in)
                                throws java.io.IOException

Throws:
  `java.io.IOException`

#### streamToBytes

    public static byte[] streamToBytes(java.io.ByteArrayInputStream in)

#### fill

    public static int[] fill(byte[] buf,
             int offset,
             java.io.InputStream in)
                      throws java.io.IOException

Throws:
  `java.io.IOException`

#### fill

    public static int[] fill(byte[] buf,
             int offset,
             java.io.ByteArrayInputStream in)

#### resizeArray

    public static byte[] resizeArray(byte[] bytes)

#### pad

    public static java.lang.String pad(java.lang.String s,
                       int length,
                       boolean left)

#### parseArgs

    public static java.util.Map parseArgs(java.lang.String[] cargs)

#### toAddress

    public static HostPort toAddress(java.lang.String target,
                     int defaultPort)
                              throws java.net.UnknownHostException

Throws:
  `java.net.UnknownHostException`

#### cipherToAuthType

    public static java.lang.String cipherToAuthType(java.lang.String cipher)

#### toInetAddress

    public static java.net.InetAddress toInetAddress(java.lang.String s)
                                              throws java.net.UnknownHostException

Utility method to make sure IP-literals don't trigger reverse-DNS lookups.

Throws:
  `java.net.UnknownHostException`

#### main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception

Throws:
  `java.lang.Exception`