org.cyberlab.support.templates
Class CopyFromStreamToFileTemplate

java.lang.Object
  extended by org.cyberlab.support.templates.CopyFromStreamToFileTemplate

public class CopyFromStreamToFileTemplate
extends java.lang.Object

Template class for copying data from and InputStream to a File using a StreamCopy processor. If the InputStream is not a BufferedInputStream it will be wrapped in an BufferedInputStream.

Author:
Mats-Gøran Karlsen
See Also:
StreamCopy

Constructor Summary
CopyFromStreamToFileTemplate()
           
 
Method Summary
static void process(java.io.InputStream fromStream, java.io.File toFile, StreamCopy processor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyFromStreamToFileTemplate

public CopyFromStreamToFileTemplate()
Method Detail

process

public static void process(java.io.InputStream fromStream,
                           java.io.File toFile,
                           StreamCopy processor)
                    throws java.lang.Exception
Parameters:
fromStream - The stream to copy from. Will be wrapped in an BufferedInputStream if it is not one itself.
toFile - The file for which to write the data
processor - a processor implementing the StreamCopy interface.
Throws:
java.lang.Exception