public class IOUtils
extends java.lang.Object
Mainly for use within the framework, but also useful for application code.
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object[] |
addAll(java.lang.Object[] array1,
java.lang.Object[] array2)
Adds the contents of 1 array to another
|
static java.lang.String |
byteArrayToHexString(byte[] in)
Convert a byte[] array to readable string format.
|
static void |
closeQuietly(java.io.Closeable closeable)
Closes a closeable gracefully without throwing exceptions etc.
|
static java.lang.String |
computeChecksum(java.io.File f,
java.lang.String algorithm) |
static void |
copy(byte[] in,
java.io.File out)
Copy the contents of the given byte array to the given output File.
|
static void |
copy(byte[] in,
java.io.OutputStream out)
Copy the contents of the given byte array to the given OutputStream.
|
static int |
copy(java.io.File in,
java.io.File out)
Copy the contents of the given input File to the given output File.
|
static int |
copy(java.io.InputStream in,
java.io.OutputStream out)
Copy the contents of the given InputStream to the given OutputStream.
|
static int |
copy(java.io.Reader in,
java.io.Writer out)
Copy the contents of the given Reader to the given Writer.
|
static void |
copy(java.lang.String in,
java.io.Writer out)
Copy the contents of the given String to the given output Writer.
|
static byte[] |
copyToByteArray(java.io.File in)
Copy the contents of the given input File into a new byte array.
|
static byte[] |
copyToByteArray(java.io.InputStream in)
Copy the contents of the given InputStream into a new byte array.
|
static java.lang.String |
copyToString(java.io.Reader in)
Copy the contents of the given Reader into a String.
|
static groovy.util.XmlSlurper |
createXmlSlurper() |
public static final int BUFFER_SIZE
public static java.lang.String byteArrayToHexString(byte[] in)
in - byte[] buffer to convert to string formatpublic static java.lang.String computeChecksum(java.io.File f,
java.lang.String algorithm)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.Object[] addAll(java.lang.Object[] array1,
java.lang.Object[] array2)
array1 - The target arrayarray2 - The source arraypublic static int copy(java.io.File in,
java.io.File out)
throws java.io.IOException
in - the file to copy fromout - the file to copy tojava.io.IOException - in case of I/O errorspublic static void copy(byte[] in,
java.io.File out)
throws java.io.IOException
in - the byte array to copy fromout - the file to copy tojava.io.IOException - in case of I/O errorspublic static byte[] copyToByteArray(java.io.File in)
throws java.io.IOException
in - the file to copy fromjava.io.IOException - in case of I/O errorspublic static int copy(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - the stream to copy fromout - the stream to copy tojava.io.IOException - in case of I/O errorspublic static void copy(byte[] in,
java.io.OutputStream out)
throws java.io.IOException
in - the byte array to copy fromout - the OutputStream to copy tojava.io.IOException - in case of I/O errorspublic static byte[] copyToByteArray(java.io.InputStream in)
throws java.io.IOException
in - the stream to copy fromjava.io.IOException - in case of I/O errorspublic static int copy(java.io.Reader in,
java.io.Writer out)
throws java.io.IOException
in - the Reader to copy fromout - the Writer to copy tojava.io.IOException - in case of I/O errorspublic static void copy(java.lang.String in,
java.io.Writer out)
throws java.io.IOException
in - the String to copy fromout - the Writer to copy tojava.io.IOException - in case of I/O errorspublic static void closeQuietly(java.io.Closeable closeable)
closeable - The closeablepublic static java.lang.String copyToString(java.io.Reader in)
throws java.io.IOException
in - the reader to copy fromjava.io.IOException - in case of I/O errorspublic static groovy.util.XmlSlurper createXmlSlurper()
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException