@Converter public final class IOConverter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IOConverter.EncodingInputStream
Encoding-aware input stream.
|
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
covertToByteBuffer(InputStream is) |
static String |
getCharsetName(Exchange exchange)
Deprecated.
|
static String |
getCharsetName(Exchange exchange,
boolean useDefault)
Deprecated.
|
static String |
normalizeCharset(String charset)
Deprecated.
|
static byte[] |
toByteArray(BufferedReader reader)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static byte[] |
toByteArray(BufferedReader reader,
Exchange exchange) |
static byte[] |
toByteArray(ByteArrayOutputStream os) |
static byte[] |
toByteArray(File file) |
static byte[] |
toByteArray(Reader reader)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static byte[] |
toByteArray(Reader reader,
Exchange exchange) |
static byte[] |
toByteArray(String value)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static byte[] |
toByteArray(String value,
Exchange exchange) |
static byte[] |
toBytes(InputStream stream) |
static File |
toFile(String name) |
static InputStream |
toInputStream(BufferedReader buffer)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static InputStream |
toInputStream(BufferedReader buffer,
Exchange exchange) |
static InputStream |
toInputStream(byte[] data) |
static InputStream |
toInputStream(ByteArrayOutputStream os) |
static InputStream |
toInputStream(File file) |
static InputStream |
toInputStream(File file,
String charset)
Converts the given
File with the given charset to InputStream with the JVM default charset |
static InputStream |
toInputStream(String text)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static InputStream |
toInputStream(StringBuffer buffer,
Exchange exchange) |
static InputStream |
toInputStream(StringBuilder builder,
Exchange exchange) |
static InputStream |
toInputStream(String text,
Exchange exchange) |
static InputStream |
toInputStream(URL url) |
static ObjectInput |
toObjectInput(InputStream stream,
Exchange exchange) |
static ObjectOutput |
toObjectOutput(OutputStream stream) |
static OutputStream |
toOutputStream(File file) |
static Properties |
toProperties(File file) |
static Properties |
toProperties(InputStream is) |
static Properties |
toProperties(Reader reader) |
static Reader |
toReader(byte[] data,
Exchange exchange) |
static BufferedReader |
toReader(File file)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static BufferedReader |
toReader(File file,
Exchange exchange) |
static BufferedReader |
toReader(File file,
String charset) |
static Reader |
toReader(InputStream in)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static Reader |
toReader(InputStream in,
Exchange exchange) |
static StringReader |
toReader(String text) |
static String |
toString(BufferedReader reader) |
static String |
toString(byte[] data)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static String |
toString(byte[] data,
Exchange exchange) |
static String |
toString(ByteArrayOutputStream os)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static String |
toString(ByteArrayOutputStream os,
Exchange exchange) |
static String |
toString(File file)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static String |
toString(File file,
Exchange exchange) |
static String |
toString(InputStream in)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static String |
toString(InputStream in,
Exchange exchange) |
static String |
toString(Reader reader) |
static String |
toString(URL url)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static String |
toString(URL url,
Exchange exchange) |
static BufferedWriter |
toWriter(File file)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static BufferedWriter |
toWriter(File file,
boolean append,
String charset) |
static BufferedWriter |
toWriter(File file,
Exchange exchange) |
static BufferedWriter |
toWriter(FileOutputStream os,
String charset) |
static Writer |
toWriter(OutputStream out)
Deprecated.
will be removed in Camel 3.0. Use the method which has 2 parameters.
|
static Writer |
toWriter(OutputStream out,
Exchange exchange) |
static void |
validateCharset(String charset)
Deprecated.
|
@Converter public static InputStream toInputStream(URL url) throws IOException
IOException
@Converter public static InputStream toInputStream(File file) throws IOException
IOException
public static InputStream toInputStream(File file, String charset) throws IOException
File
with the given charset to InputStream
with the JVM default charsetfile
- the file to be convertedcharset
- the charset the file is read withIOException
@Deprecated public static BufferedReader toReader(File file) throws IOException
IOException
@Converter public static BufferedReader toReader(File file, Exchange exchange) throws IOException
IOException
public static BufferedReader toReader(File file, String charset) throws IOException
IOException
@Converter public static File toFile(String name)
@Converter public static OutputStream toOutputStream(File file) throws FileNotFoundException
FileNotFoundException
@Deprecated public static BufferedWriter toWriter(File file) throws IOException
IOException
@Converter public static BufferedWriter toWriter(File file, Exchange exchange) throws IOException
IOException
public static BufferedWriter toWriter(File file, boolean append, String charset) throws IOException
IOException
public static BufferedWriter toWriter(FileOutputStream os, String charset) throws IOException
IOException
@Deprecated public static Reader toReader(InputStream in) throws IOException
IOException
@Converter public static Reader toReader(InputStream in, Exchange exchange) throws IOException
IOException
@Converter public static Reader toReader(byte[] data, Exchange exchange) throws IOException
IOException
@Deprecated public static Writer toWriter(OutputStream out) throws IOException
IOException
@Converter public static Writer toWriter(OutputStream out, Exchange exchange) throws IOException
IOException
@Converter public static StringReader toReader(String text)
@Deprecated public static InputStream toInputStream(String text) throws IOException
IOException
@Converter public static InputStream toInputStream(String text, Exchange exchange) throws IOException
IOException
@Converter public static InputStream toInputStream(StringBuffer buffer, Exchange exchange) throws IOException
IOException
@Converter public static InputStream toInputStream(StringBuilder builder, Exchange exchange) throws IOException
IOException
@Deprecated public static InputStream toInputStream(BufferedReader buffer) throws IOException
IOException
@Converter public static InputStream toInputStream(BufferedReader buffer, Exchange exchange) throws IOException
IOException
@Deprecated public static String toString(byte[] data) throws IOException
IOException
@Converter public static String toString(byte[] data, Exchange exchange) throws IOException
IOException
@Deprecated public static String toString(File file) throws IOException
IOException
@Converter public static String toString(File file, Exchange exchange) throws IOException
IOException
@Converter public static byte[] toByteArray(File file) throws IOException
IOException
@Deprecated public static byte[] toByteArray(Reader reader) throws IOException
IOException
@Converter public static byte[] toByteArray(Reader reader, Exchange exchange) throws IOException
IOException
@Deprecated public static String toString(URL url) throws IOException
IOException
@Converter public static String toString(URL url, Exchange exchange) throws IOException
IOException
@Converter public static String toString(Reader reader) throws IOException
IOException
@Converter public static String toString(BufferedReader reader) throws IOException
IOException
@Deprecated public static byte[] toByteArray(BufferedReader reader) throws IOException
IOException
@Converter public static byte[] toByteArray(BufferedReader reader, Exchange exchange) throws IOException
IOException
@Deprecated public static byte[] toByteArray(String value) throws IOException
IOException
@Converter public static byte[] toByteArray(String value, Exchange exchange) throws IOException
IOException
@Deprecated public static String toString(InputStream in) throws IOException
IOException
@Converter public static String toString(InputStream in, Exchange exchange) throws IOException
IOException
@Converter public static InputStream toInputStream(byte[] data)
@Converter public static ObjectOutput toObjectOutput(OutputStream stream) throws IOException
IOException
@Converter public static ObjectInput toObjectInput(InputStream stream, Exchange exchange) throws IOException
IOException
@Converter public static byte[] toBytes(InputStream stream) throws IOException
IOException
@Converter public static byte[] toByteArray(ByteArrayOutputStream os)
@Converter public static ByteBuffer covertToByteBuffer(InputStream is) throws IOException
IOException
@Deprecated public static String toString(ByteArrayOutputStream os) throws IOException
IOException
@Converter public static String toString(ByteArrayOutputStream os, Exchange exchange) throws IOException
IOException
@Converter public static InputStream toInputStream(ByteArrayOutputStream os)
@Converter public static Properties toProperties(File file) throws IOException
IOException
@Converter public static Properties toProperties(InputStream is) throws IOException
IOException
@Converter public static Properties toProperties(Reader reader) throws IOException
IOException
@Deprecated public static String getCharsetName(Exchange exchange, boolean useDefault)
Exchange.CHARSET_NAME
.exchange
- the exchangeuseDefault
- should we fallback and use JVM default charset if no property existed?@Deprecated public static String getCharsetName(Exchange exchange)
@Deprecated public static String normalizeCharset(String charset)
@Deprecated public static void validateCharset(String charset) throws UnsupportedCharsetException
UnsupportedCharsetException
Apache Camel