org.apache.felix.ipojo.manipulator.util

## Class Streams

- java.lang.Object
- - org.apache.felix.ipojo.manipulator.util.Streams

    public class Streams
    extends Object

`Streams` is a utility class that helps to manipulate streams.

Author:
  Felix Project Team

### Method Summary

All Methods Static Methods Concrete Methods
`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`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### close

    public static void close(Closeable... streams)

Close all the streams

Parameters:
  `streams` - Streams to be closed

#### transfer

    public static void transfer(InputStream is,
                                OutputStream os)
                         throws IOException

Transfer the given `InputStream` content in the given `OutputStream`.

Parameters:
  `is` - input
  `os` - output
Throws:
  `IOException` - if there is a transfer error.

#### readBytes

    public static byte[] readBytes(InputStream is)
                            throws IOException

Read the content of the given InputStream as a byte array. Notice that this method automatically closes the InputStream

Parameters:
  `is` - source
Returns:
  the content of the InputStream
Throws:
  `IOException` - if stream's content cannot be read/written