org.apache.camel.converter
Class IOConverter

java.lang.Object
  extended by org.apache.camel.converter.IOConverter

public final class IOConverter
extends Object

Some core java.io based Type Converters

Version:
$Revision: 36565 $

Method Summary
protected static void copy(InputStream stream, ByteArrayOutputStream bos)
           
static byte[] toBytes(InputStream stream)
           
static File toFile(String name)
           
static InputStream toInputStream(BufferedReader buffer)
           
static InputStream toInputStream(byte[] data)
           
static InputStream toInputStream(File file)
           
static InputStream toInputStream(String text)
           
static InputStream toInputStream(URL url)
           
static InputStream toInputStrean(DOMSource source)
           
static ObjectInput toObjectInput(InputStream stream)
           
static ObjectOutput toObjectOutput(OutputStream stream)
           
static OutputStream toOutputStream(File file)
           
static BufferedReader toReader(File file)
           
static Reader toReader(InputStream in)
           
static StringReader toReader(String text)
           
static String toString(BufferedReader reader)
           
static String toString(byte[] data)
           
static String toString(File file)
           
static String toString(InputStream in)
           
static String toString(Reader reader)
           
static String toString(Source source)
           
static String toString(Source source, Properties props)
           
static String toString(URL url)
           
static BufferedWriter toWriter(File file)
           
static Writer toWriter(OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toInputStream

public static InputStream toInputStream(URL url)
                                 throws IOException
Throws:
IOException

toInputStream

public static InputStream toInputStream(File file)
                                 throws FileNotFoundException
Throws:
FileNotFoundException

toReader

public static BufferedReader toReader(File file)
                               throws FileNotFoundException
Throws:
FileNotFoundException

toFile

public static File toFile(String name)
                   throws FileNotFoundException
Throws:
FileNotFoundException

toOutputStream

public static OutputStream toOutputStream(File file)
                                   throws FileNotFoundException
Throws:
FileNotFoundException

toWriter

public static BufferedWriter toWriter(File file)
                               throws IOException
Throws:
IOException

toReader

public static Reader toReader(InputStream in)
                       throws FileNotFoundException
Throws:
FileNotFoundException

toWriter

public static Writer toWriter(OutputStream out)
                       throws FileNotFoundException
Throws:
FileNotFoundException

toReader

public static StringReader toReader(String text)

toInputStream

public static InputStream toInputStream(String text)

toInputStream

public static InputStream toInputStream(BufferedReader buffer)
                                 throws IOException
Throws:
IOException

toInputStrean

public static InputStream toInputStrean(DOMSource source)
                                 throws TransformerException,
                                        IOException
Throws:
TransformerException
IOException

toString

public static String toString(byte[] data)

toString

public static String toString(File file)
                       throws IOException
Throws:
IOException

toString

public static String toString(URL url)
                       throws IOException
Throws:
IOException

toString

public static String toString(Reader reader)
                       throws IOException
Throws:
IOException

toString

public static String toString(BufferedReader reader)
                       throws IOException
Throws:
IOException

toString

public static String toString(InputStream in)
                       throws IOException
Throws:
IOException

toString

public static String toString(Source source)
                       throws TransformerException,
                              IOException
Throws:
TransformerException
IOException

toString

public static String toString(Source source,
                              Properties props)
                       throws TransformerException,
                              IOException
Throws:
TransformerException
IOException

toInputStream

public static InputStream toInputStream(byte[] data)

toObjectOutput

public static ObjectOutput toObjectOutput(OutputStream stream)
                                   throws IOException
Throws:
IOException

toObjectInput

public static ObjectInput toObjectInput(InputStream stream)
                                 throws IOException
Throws:
IOException

toBytes

public static byte[] toBytes(InputStream stream)
                      throws IOException
Throws:
IOException

copy

protected static void copy(InputStream stream,
                           ByteArrayOutputStream bos)
                    throws IOException
Throws:
IOException


Copyright © 2008 IONA Open Source Community. All Rights Reserved.