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