java.lang.Object
org.xnio.streams.Streams
Stream utility class.
- Author:
- David M. Lloyd
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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 streamoutput
- the destination streamclose
-true
if the input and output streams should be closedbufferSize
- 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 streamoutput
- the destination streamclose
-true
if the input and output streams should be closed- Throws:
IOException
- if an I/O error occurs
-
copyStream
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:
IOException
- if an I/O error occurs
-