com.pyxis.greenhopper.jira.util
Class IOUtils

java.lang.Object
  extended by com.pyxis.greenhopper.jira.util.IOUtils

public class IOUtils
extends java.lang.Object


Constructor Summary
IOUtils()
           
 
Method Summary
static void closeQuietly(java.io.InputStream input)
           
static void closeQuietly(java.io.OutputStream output)
           
static int copy(java.io.InputStream input, java.io.OutputStream output)
           
static void copyFile(java.io.File srcFile, java.io.File destFile)
           
static long copyLarge(java.io.InputStream input, java.io.OutputStream output)
           
static java.io.FileInputStream openInputStream(java.io.File file)
           
static byte[] readFileToByteArray(java.io.File file)
          Reads the contents of a file into a byte array.
static byte[] toByteArray(java.io.InputStream input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtils

public IOUtils()
Method Detail

readFileToByteArray

public static byte[] readFileToByteArray(java.io.File file)
                                  throws java.io.IOException
Reads the contents of a file into a byte array. The file is always closed.

Parameters:
file - the file to read, must not be null
Returns:
the file contents, never null
Throws:
java.io.IOException - in case of an I/O error
Since:
Commons IO 1.1

openInputStream

public static java.io.FileInputStream openInputStream(java.io.File file)
                                               throws java.io.IOException
Throws:
java.io.IOException

toByteArray

public static byte[] toByteArray(java.io.InputStream input)
                          throws java.io.IOException
Throws:
java.io.IOException

copy

public static int copy(java.io.InputStream input,
                       java.io.OutputStream output)
                throws java.io.IOException
Throws:
java.io.IOException

copyFile

public static void copyFile(java.io.File srcFile,
                            java.io.File destFile)
                     throws java.io.IOException
Throws:
java.io.IOException

copyLarge

public static long copyLarge(java.io.InputStream input,
                             java.io.OutputStream output)
                      throws java.io.IOException
Throws:
java.io.IOException

closeQuietly

public static void closeQuietly(java.io.InputStream input)

closeQuietly

public static void closeQuietly(java.io.OutputStream output)


Copyright © 2007-2011 Atlassian. All Rights Reserved.