net.sourceforge.cobertura.util
public abstract class IOUtil extends java.lang.Object
Constructor and Description |
---|
IOUtil() |
Modifier and Type | Method and Description |
---|---|
static java.io.InputStream |
closeInputStream(java.io.InputStream in)
Closes an input stream.
|
static java.io.OutputStream |
closeOutputStream(java.io.OutputStream out)
Closes an output stream.
|
static void |
copyStream(java.io.InputStream in,
java.io.OutputStream out)
Copies bytes from input stream into the output stream.
|
static byte[] |
createByteArrayFromInputStream(java.io.InputStream in)
Returns an array that contains values read from the
given input stream.
|
static java.io.PrintWriter |
getPrintWriter(java.io.File file) |
static void |
moveFile(java.io.File sourceFile,
java.io.File destinationFile)
Moves a file from one location to other.
|
public IOUtil()
public static void copyStream(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
- If either passed stream will throw IOException.java.lang.NullPointerException
- If either passed stream is null.public static byte[] createByteArrayFromInputStream(java.io.InputStream in) throws java.io.IOException
java.lang.NullPointerException
- If null stream is passed.java.io.IOException
public static void moveFile(java.io.File sourceFile, java.io.File destinationFile) throws java.io.IOException
java.io.IOException
- If IO exception occur during moving.java.lang.NullPointerException
- If either passed file is null.public static java.io.InputStream closeInputStream(java.io.InputStream in)
in
- The stream to close.public static java.io.OutputStream closeOutputStream(java.io.OutputStream out)
out
- The stream to close.public static java.io.PrintWriter getPrintWriter(java.io.File file) throws java.io.UnsupportedEncodingException, java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.FileNotFoundException