com.atlassian.jira.util
Class StreamCopyingConsumer

java.lang.Object
  extended by com.atlassian.jira.util.StreamCopyingConsumer
All Implemented Interfaces:
Consumer<java.io.InputStream>

public class StreamCopyingConsumer
extends java.lang.Object
implements Consumer<java.io.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


Constructor Summary
StreamCopyingConsumer(java.io.OutputStream outputStream, int bufferSize)
          Copies the consumed InputStream into the given OutputStream (without closing anything).
 
Method Summary
 void consume(java.io.InputStream inputStream)
          Consume the product.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamCopyingConsumer

public StreamCopyingConsumer(java.io.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.
Method Detail

consume

public void consume(@NotNull
                    java.io.InputStream inputStream)
Description copied from interface: Consumer
Consume the product.

Specified by:
consume in interface Consumer<java.io.InputStream>
Parameters:
inputStream - must not be null


Copyright © 2002-2010 Atlassian. All Rights Reserved.