Package org.xnio.streams

# Class Streams

java.lang.Object
org.xnio.streams.Streams

public final class Streams extends Object
Stream utility class.

Author:
  David M. Lloyd

## Method Summary

Modifier and Type
Method
Description
`static void`
`copyStream(InputStream input, OutputStream output)`
Copy from one stream to another.
`static void`
`copyStream(InputStream input, OutputStream output, boolean close)`
Copy from one stream to another.
`static void`
`copyStream(InputStream input, OutputStream output, boolean close, int bufferSize)`
Copy from one stream to another.

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

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

## Method Details

### copyStream

public static void copyStream(InputStream input, OutputStream output, boolean close, int bufferSize) throws IOException
Copy from one stream to another.

Parameters:
  `input` - the source stream
  `output` - the destination stream
  `close` - `true` if the input and output streams should be closed
  `bufferSize` - the buffer size
Throws:
  `IOException` - if an I/O error occurs

### copyStream

public static void copyStream(InputStream input, OutputStream output, boolean close) throws IOException
Copy from one stream to another. A default buffer size is assumed.

Parameters:
  `input` - the source stream
  `output` - the destination stream
  `close` - `true` if the input and output streams should be closed
Throws:
  `IOException` - if an I/O error occurs

### copyStream

public static void copyStream(InputStream input, OutputStream output) throws IOException
Copy from one stream to another. A default buffer size is assumed, and both streams are closed on completion.

Parameters:
  `input` - the source stream
  `output` - the destination stream
Throws:
  `IOException` - if an I/O error occurs