Package mil.nga.tiff.io
Class IOUtils
- java.lang.Object
-
- mil.nga.tiff.io.IOUtils
-
public class IOUtils extends Object
Input / Output utility methods- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static intCOPY_BUFFER_SIZECopy stream buffer chunk size in bytes
-
Constructor Summary
Constructors Constructor Description IOUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopyFile(File copyFrom, File copyTo)Copy a file to a file locationstatic voidcopyStream(InputStream copyFrom, File copyTo)Copy an input stream to a file locationstatic voidcopyStream(InputStream copyFrom, OutputStream copyTo)Copy an input stream to an output streamstatic byte[]fileBytes(File file)Get the file bytesstatic byte[]streamBytes(InputStream stream)Get the stream bytes
-
-
-
Method Detail
-
copyFile
public static void copyFile(File copyFrom, File copyTo) throws IOException
Copy a file to a file location- Parameters:
copyFrom- file to copycopyTo- file to copy to- Throws:
IOException- upon failure to copy file
-
copyStream
public static void copyStream(InputStream copyFrom, File copyTo) throws IOException
Copy an input stream to a file location- Parameters:
copyFrom- stream to copycopyTo- file to copy to- Throws:
IOException- upon failure to copy the stream
-
fileBytes
public static byte[] fileBytes(File file) throws IOException
Get the file bytes- Parameters:
file- file- Returns:
- bytes
- Throws:
IOException- upon failure to read the file
-
streamBytes
public static byte[] streamBytes(InputStream stream) throws IOException
Get the stream bytes- Parameters:
stream- input stream- Returns:
- bytes
- Throws:
IOException- upon failure to read stream bytes
-
copyStream
public static void copyStream(InputStream copyFrom, OutputStream copyTo) throws IOException
Copy an input stream to an output stream- Parameters:
copyFrom- stream to copycopyTo- stream to copy to- Throws:
IOException- upon failure to copy stream
-
-