Apache CXF API

org.apache.cxf.helpers
Class IOUtils

java.lang.Object
  extended by org.apache.cxf.helpers.IOUtils

public final class IOUtils
extends java.lang.Object


Field Summary
static java.nio.charset.Charset UTF8_CHARSET
           
 
Method Summary
static int copy(java.io.InputStream input, java.io.OutputStream output)
           
static int copy(java.io.InputStream input, java.io.OutputStream output, int bufferSize)
           
static void copy(java.io.Reader input, java.io.Writer output, int bufferSize)
           
static int copyAndCloseInput(java.io.InputStream input, java.io.OutputStream output)
           
static int copyAndCloseInput(java.io.InputStream input, java.io.OutputStream output, int bufferSize)
           
static java.io.ByteArrayInputStream loadIntoBAIS(java.io.InputStream in)
          Load the InputStream into memory and return a ByteArrayInputStream that represents it.
static java.lang.String newStringFromBytes(byte[] bytes)
          Use this function instead of new String(byte[]) to avoid surprises from non-standard default encodings.
static java.lang.String newStringFromBytes(byte[] bytes, int start, int length)
          Use this function instead of new String(byte[], int, int) to avoid surprises from non-standard default encodings.
static byte[] readBytesFromStream(java.io.InputStream in)
           
static java.lang.String readStringFromStream(java.io.InputStream in)
           
static java.lang.String toString(java.io.InputStream input)
           
static java.lang.String toString(java.io.InputStream input, int bufferSize)
           
static java.lang.String toString(java.io.Reader input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF8_CHARSET

public static final java.nio.charset.Charset UTF8_CHARSET
Method Detail

newStringFromBytes

public static java.lang.String newStringFromBytes(byte[] bytes)
Use this function instead of new String(byte[]) to avoid surprises from non-standard default encodings.

Parameters:
bytes -
Returns:

newStringFromBytes

public static java.lang.String newStringFromBytes(byte[] bytes,
                                                  int start,
                                                  int length)
Use this function instead of new String(byte[], int, int) to avoid surprises from non-standard default encodings.

Parameters:
bytes -
start -
length -
Returns:

copy

public static int copy(java.io.InputStream input,
                       java.io.OutputStream output)
                throws java.io.IOException
Throws:
java.io.IOException

copyAndCloseInput

public static int copyAndCloseInput(java.io.InputStream input,
                                    java.io.OutputStream output)
                             throws java.io.IOException
Throws:
java.io.IOException

copyAndCloseInput

public static int copyAndCloseInput(java.io.InputStream input,
                                    java.io.OutputStream output,
                                    int bufferSize)
                             throws java.io.IOException
Throws:
java.io.IOException

copy

public static int copy(java.io.InputStream input,
                       java.io.OutputStream output,
                       int bufferSize)
                throws java.io.IOException
Throws:
java.io.IOException

copy

public static void copy(java.io.Reader input,
                        java.io.Writer output,
                        int bufferSize)
                 throws java.io.IOException
Throws:
java.io.IOException

toString

public static java.lang.String toString(java.io.InputStream input)
                                 throws java.io.IOException
Throws:
java.io.IOException

toString

public static java.lang.String toString(java.io.InputStream input,
                                        int bufferSize)
                                 throws java.io.IOException
Throws:
java.io.IOException

toString

public static java.lang.String toString(java.io.Reader input)
                                 throws java.io.IOException
Throws:
java.io.IOException

readStringFromStream

public static java.lang.String readStringFromStream(java.io.InputStream in)
                                             throws java.io.IOException
Throws:
java.io.IOException

loadIntoBAIS

public static java.io.ByteArrayInputStream loadIntoBAIS(java.io.InputStream in)
                                                 throws java.io.IOException
Load the InputStream into memory and return a ByteArrayInputStream that represents it. Closes the in stream.

Parameters:
in -
Returns:
Throws:
java.io.IOException

readBytesFromStream

public static byte[] readBytesFromStream(java.io.InputStream in)
                                  throws java.io.IOException
Throws:
java.io.IOException

Apache CXF API

Apache CXF