org.apache.camel.util
Class IOHelper

java.lang.Object
  extended by org.apache.camel.util.IOHelper

public final class IOHelper
extends Object

IO helper class.

Version:
$Revision: 769303 $

Method Summary
static int copy(InputStream input, OutputStream output)
           
static int copy(InputStream input, OutputStream output, int bufferSize)
           
static void copyAndCloseInput(InputStream input, OutputStream output)
           
static void copyAndCloseInput(InputStream input, OutputStream output, int bufferSize)
           
static IOException createIOException(String message, Throwable cause)
          A factory method which creates an IOException from the given exception and message
static IOException createIOException(Throwable cause)
          A factory method which creates an IOException from the given exception and message
static String newStringFromBytes(byte[] bytes)
          Use this function instead of new String(byte[]) to avoid surprises from non-standard default encodings.
static 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newStringFromBytes

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


newStringFromBytes

public static 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.


createIOException

public static IOException createIOException(Throwable cause)
A factory method which creates an IOException from the given exception and message


createIOException

public static IOException createIOException(String message,
                                            Throwable cause)
A factory method which creates an IOException from the given exception and message


copy

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

copy

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

copyAndCloseInput

public static void copyAndCloseInput(InputStream input,
                                     OutputStream output)
                              throws IOException
Throws:
IOException

copyAndCloseInput

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


Apache CAMEL