public class StreamUtils extends Object
Constructor and Description |
---|
StreamUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
close(InputStream inputStream) |
static void |
close(OutputStream outputStream) |
static void |
close(Reader reader) |
static void |
close(Writer writer) |
static void |
quietlyClose(InputStream inputStream) |
static void |
quietlyClose(OutputStream outputStream) |
static void |
quietlyClose(Reader reader) |
static void |
quietlyClose(Writer writer) |
static String |
readToString(InputStream inputStream) |
static String |
readToString(InputStream inputStream,
String encoding) |
static String |
readToString(Reader reader) |
static void |
writeTo(byte[] data,
OutputStream outputStream)
Writes the given string to the given output stream.
|
static void |
writeTo(InputStream inputStream,
OutputStream outputStream)
Writes the content of the given input stream to the given output stream.
|
public static final String UTF_8
public static void writeTo(InputStream inputStream, OutputStream outputStream) throws IOException
outputStream
- the output stream to write toinputStream
- the input stream to read fromIOException
public static String readToString(InputStream inputStream) throws IOException
IOException
public static String readToString(InputStream inputStream, String encoding) throws IOException
IOException
public static String readToString(Reader reader) throws IOException
IOException
public static void writeTo(byte[] data, OutputStream outputStream) throws IOException
data
- the data to writeoutputStream
- the stream to write toIOException
public static void close(InputStream inputStream) throws IOException
IOException
public static void quietlyClose(InputStream inputStream)
public static void close(OutputStream outputStream) throws IOException
IOException
public static void quietlyClose(OutputStream outputStream)
public static void close(Reader reader) throws IOException
IOException
public static void quietlyClose(Reader reader)
public static void close(Writer writer) throws IOException
IOException
public static void quietlyClose(Writer writer)
Copyright © 2017 JBoss by Red Hat. All rights reserved.