public final class StreamUtil extends Object
| Constructor and Description |
|---|
StreamUtil() |
| Modifier and Type | Method and Description |
|---|---|
static long |
copy(InputStream is,
OutputStream os)
Pumps the input stream to the output stream.
|
static InputStream |
createInputStream(Object source)
Create an input stream supporting the following types
String (using the UTF-8 encoded content)
File
byte[]
char[]
ByteArrayOutputStream
InputStream
|
static OutputStream |
createOutputStream(Object target)
Create an output stream supporting the following types
File
String
OutputStream
|
public static InputStream createInputStream(Object source) throws IOException
source - the source objectIOException - creating the input stream failedpublic static OutputStream createOutputStream(Object target) throws IOException
target - the target objectIOException - creating the output stream failedpublic static long copy(InputStream is, OutputStream os) throws IOException
is - the source input streamos - the target output streamIOException - the copying failedCopyright © 2008–2020 The Apache Software Foundation. All rights reserved.