- java.lang.Object
-
- org.xnio.streams.Streams
-
public final class Streams extends java.lang.Object
Stream utility class.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyStream(java.io.InputStream input, java.io.OutputStream output)
Copy from one stream to another.static void
copyStream(java.io.InputStream input, java.io.OutputStream output, boolean close)
Copy from one stream to another.static void
copyStream(java.io.InputStream input, java.io.OutputStream output, boolean close, int bufferSize)
Copy from one stream to another.
-
-
-
Method Detail
-
copyStream
public static void copyStream(java.io.InputStream input, java.io.OutputStream output, boolean close, int bufferSize) throws java.io.IOException
Copy from one stream to another.- Parameters:
input
- the source streamoutput
- the destination streamclose
-true
if the input and output streams should be closedbufferSize
- the buffer size- Throws:
java.io.IOException
- if an I/O error occurs
-
copyStream
public static void copyStream(java.io.InputStream input, java.io.OutputStream output, boolean close) throws java.io.IOException
Copy from one stream to another. A default buffer size is assumed.- Parameters:
input
- the source streamoutput
- the destination streamclose
-true
if the input and output streams should be closed- Throws:
java.io.IOException
- if an I/O error occurs
-
copyStream
public static void copyStream(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
Copy from one stream to another. A default buffer size is assumed, and both streams are closed on completion.- Parameters:
input
- the source streamoutput
- the destination stream- Throws:
java.io.IOException
- if an I/O error occurs
-
-