Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE |
static String |
FILE_PATH_SEP |
Modifier and Type | Method and Description |
---|---|
static long |
copy(InputStream input,
OutputStream output)
Copy bytes from a large (over 2GB)
InputStream to an
OutputStream . |
static long |
copyWhileDataAvailable(InputStream input,
OutputStream output) |
static void |
deleteAllFromDirectory(File theWorkfilesDir) |
static void |
deleteAllFromDirectoryExcept(File theDirectory,
List<File> theExcept) |
static byte[] |
readClasspathIntoByteArray(String theString)
Read a classpath resource into a byte array
|
static byte[] |
readInputStreamIntoByteArraWhileDataAvailable(InputStream res) |
static byte[] |
readInputStreamIntoByteArray(InputStream res)
Read an entire input stream into a byte array
|
public static final int DEFAULT_BUFFER_SIZE
public static final String FILE_PATH_SEP
public static long copy(InputStream input, OutputStream output) throws IOException
Copy bytes from a large (over 2GB) InputStream
to an
OutputStream
.
This method is based on an implementation from Apache Commons-IO
input
- the InputStream
to read fromoutput
- the OutputStream
to write toNullPointerException
- if the input or output is nullIOException
- if an I/O error occurspublic static long copyWhileDataAvailable(InputStream input, OutputStream output) throws IOException
IOException
public static void deleteAllFromDirectory(File theWorkfilesDir)
public static void deleteAllFromDirectoryExcept(File theDirectory, List<File> theExcept) throws IOException
IOException
public static byte[] readClasspathIntoByteArray(String theString) throws IOException
IOException
public static byte[] readInputStreamIntoByteArraWhileDataAvailable(InputStream res) throws IOException
IOException
public static byte[] readInputStreamIntoByteArray(InputStream res) throws IOException
IOException
Copyright © 2012–2017 University Health Network. All rights reserved.