public class StreamUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CHUNK_SIZE
Default size to use for reading buffers.
|
Modifier and Type | Method and Description |
---|---|
static long |
copy(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Copy the inputStream to the outputStream.
|
static long |
copy(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
int bufferSize)
Copy the inputStream to the outputStream using a buffer of the specified size
|
static long |
copy(java.io.Reader reader,
java.io.Writer writer)
Copy the reader to the writer.
|
static long |
copy(java.io.Reader reader,
java.io.Writer writer,
int bufferSize)
Copy the reader to the writer using a buffer of the specified size
|
public static final int DEFAULT_CHUNK_SIZE
public static long copy(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws java.io.IOException
DEFAULT_CHUNK_SIZE
).inputStream
- The input stream to readoutputStream
- The output stream to write tojava.io.IOException
- If a problem occurred accessing either streampublic static long copy(java.io.InputStream inputStream, java.io.OutputStream outputStream, int bufferSize) throws java.io.IOException
inputStream
- The input stream to readoutputStream
- The output stream to write tobufferSize
- The size of the buffer to use for readingjava.io.IOException
- If a problem occurred accessing either streampublic static long copy(java.io.Reader reader, java.io.Writer writer) throws java.io.IOException
DEFAULT_CHUNK_SIZE
).reader
- The reader to read fromwriter
- The writer to write tojava.io.IOException
- If a problem occurred accessing reader or writerpublic static long copy(java.io.Reader reader, java.io.Writer writer, int bufferSize) throws java.io.IOException
reader
- The reader to read fromwriter
- The writer to write tobufferSize
- The size of the buffer to use for readingjava.io.IOException
- If a problem occurred accessing either streamCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.