org.apache.sanselan.util
Class IOUtils

java.lang.Object
  extended by org.apache.sanselan.util.IOUtils
All Implemented Interfaces:
SanselanConstants

public class IOUtils
extends java.lang.Object
implements SanselanConstants


Field Summary
 
Fields inherited from interface org.apache.sanselan.SanselanConstants
BUFFERED_IMAGE_FACTORY, PARAM_KEY_COMPRESSION, PARAM_KEY_FILENAME, PARAM_KEY_FORMAT, PARAM_KEY_READ_THUMBNAILS, PARAM_KEY_STRICT, PARAM_KEY_VERBOSE, PARAM_KEY_XMP_XML
 
Method Summary
static boolean copyFileNio(java.io.File src, java.io.File dst)
           
static void copyStreamToStream(java.io.InputStream src, java.io.OutputStream dst)
           
static void copyStreamToStream(java.io.InputStream src, java.io.OutputStream dst, boolean close_streams)
           
static byte[] getFileBytes(java.io.File file)
          Reads a File into memory.
static byte[] getInputStreamBytes(java.io.InputStream is)
          Reads an InputStream to the end.
static void putInputStreamToFile(java.io.InputStream src, java.io.File file)
           
static void writeToFile(byte[] src, java.io.File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInputStreamBytes

public static byte[] getInputStreamBytes(java.io.InputStream is)
                                  throws java.io.IOException
Reads an InputStream to the end.

Parameters:
is - The InputStream to read.
Returns:
A byte array containing the contents of the InputStream
Throws:
java.io.IOException
See Also:
InputStream

getFileBytes

public static byte[] getFileBytes(java.io.File file)
                           throws java.io.IOException
Reads a File into memory.

Parameters:
file - The File to read.
Returns:
A byte array containing the contents of the File
Throws:
java.io.IOException
See Also:
InputStream

writeToFile

public static void writeToFile(byte[] src,
                               java.io.File file)
                        throws java.io.IOException
Throws:
java.io.IOException

putInputStreamToFile

public static void putInputStreamToFile(java.io.InputStream src,
                                        java.io.File file)
                                 throws java.io.IOException
Throws:
java.io.IOException

copyStreamToStream

public static void copyStreamToStream(java.io.InputStream src,
                                      java.io.OutputStream dst)
                               throws java.io.IOException
Throws:
java.io.IOException

copyStreamToStream

public static void copyStreamToStream(java.io.InputStream src,
                                      java.io.OutputStream dst,
                                      boolean close_streams)
                               throws java.io.IOException
Throws:
java.io.IOException

copyFileNio

public static final boolean copyFileNio(java.io.File src,
                                        java.io.File dst)
                                 throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2007-2009. All Rights Reserved.