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 int
COPY_BUFFER_SIZE
Copy 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 void
copyFile(File copyFrom, File copyTo)
Copy a file to a file locationstatic void
copyStream(InputStream copyFrom, File copyTo)
Copy an input stream to a file locationstatic void
copyStream(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
-
-