public class Streams
extends java.lang.Object
Streams
is a utility class that helps to manipulate streams.Modifier and Type | Method and Description |
---|---|
static void |
close(java.io.Closeable... streams)
Close all the streams
|
static byte[] |
readBytes(java.io.InputStream is)
Read the content of the given InputStream as a byte array.
|
static void |
transfer(java.io.InputStream is,
java.io.OutputStream os)
Transfer the given
InputStream content in the given OutputStream . |
public static void close(java.io.Closeable... streams)
streams
- Streams to be closedpublic static void transfer(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
InputStream
content in the given OutputStream
.is
- inputos
- outputjava.io.IOException
- if there is a transfer error.public static byte[] readBytes(java.io.InputStream is) throws java.io.IOException
is
- sourcejava.io.IOException
- if stream's content cannot be read/writtenCopyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.