public class StreamCopyingConsumer extends Object implements Consumer<InputStream>
InputStream
to the configured OutputStream
. If there is an
IOException during the copy, this will be thrown from the consume method inside a RuntimeException, but either
way theConstructor and Description |
---|
StreamCopyingConsumer(OutputStream outputStream,
int bufferSize)
Copies the consumed
InputStream into the given OutputStream (without closing anything). |
public StreamCopyingConsumer(OutputStream outputStream, int bufferSize)
InputStream
into the given OutputStream (without closing anything).
If there is a problem copying, the IOException will be thrown wrapped in a RuntimeException.outputStream
- the OutputStream to copy to.bufferSize
- the desired number of bytes in the copy buffer.public void consume(@Nonnull InputStream inputStream)
Consumer
consume
in interface Consumer<InputStream>
inputStream
- must not be nullCopyright © 2002-2015 Atlassian. All Rights Reserved.