com.vinculumtech.platform.util
Class StreamHelper

java.lang.Object
  extended bycom.vinculumtech.platform.util.StreamHelper

public final class StreamHelper
extends java.lang.Object

Utility class which provides methods to close streams, and traps any exceptions which may occur. Nothing will happen if the specified stream is null.

These methods are useful for finally blocks.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/platform/util/StreamHelper.java#1 $

Constructor Summary
StreamHelper()
           
 
Method Summary
static void close(java.io.InputStream in)
          Call InputStream.close().
static void close(java.io.OutputStream out)
          Call OutputStream.close().
static void close(java.io.Reader in)
          Call Reader.close().
static void close(java.io.Writer out)
          Call Writer.close().
static void copy(java.io.File fromFile, java.io.File toFile)
           
static void copy(java.io.File fromFile, java.io.File toFile, int bufferSize)
           
static void copy(java.net.URL fromUrl, java.io.File toFile)
           
static void copy(java.net.URL fromUrl, java.io.File toFile, int bufferSize)
          Copy content from an URL to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamHelper

public StreamHelper()
Method Detail

close

public static void close(java.io.InputStream in)
Call InputStream.close().


close

public static void close(java.io.OutputStream out)
Call OutputStream.close().


close

public static void close(java.io.Reader in)
Call Reader.close().


close

public static void close(java.io.Writer out)
Call Writer.close().


copy

public static void copy(java.net.URL fromUrl,
                        java.io.File toFile,
                        int bufferSize)
Copy content from an URL to a file.


copy

public static void copy(java.net.URL fromUrl,
                        java.io.File toFile)

copy

public static void copy(java.io.File fromFile,
                        java.io.File toFile,
                        int bufferSize)

copy

public static void copy(java.io.File fromFile,
                        java.io.File toFile)


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.