com.atlassian.jira.util
Class StreamCopyingConsumer
java.lang.Object
com.atlassian.jira.util.StreamCopyingConsumer
- All Implemented Interfaces:
- Consumer<InputStream>
public class StreamCopyingConsumer
- extends Object
- implements Consumer<InputStream>
Copies an 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 the
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamCopyingConsumer
public StreamCopyingConsumer(OutputStream outputStream,
int bufferSize)
- Copies the consumed
InputStream
into the given OutputStream (without closing anything).
If there is a problem copying, the IOException will be thrown wrapped in a RuntimeException.
- Parameters:
outputStream
- the OutputStream to copy to.bufferSize
- the desired number of bytes in the copy buffer.
consume
public void consume(@NotNull
InputStream inputStream)
- Description copied from interface:
Consumer
- Consume the product.
- Specified by:
consume
in interface Consumer<InputStream>
- Parameters:
inputStream
- must not be null
Copyright © 2002-2009 Atlassian. All Rights Reserved.