net.sourceforge.cobertura.util
Class IOUtil
java.lang.Object
net.sourceforge.cobertura.util.IOUtil
Helper class with useful I/O operations.
static InputStream | closeInputStream(InputStream in) - Closes an input stream.
|
static OutputStream | closeOutputStream(OutputStream out) - Closes an output stream.
|
static void | copyStream(InputStream in, OutputStream out) - Copies bytes from input stream into the output stream.
|
static byte[] | createByteArrayFromInputStream(InputStream in) - Returns an array that contains values read from the
given input stream.
|
static void | moveFile(File sourceFile, File destinationFile) - Moves a file from one location to other.
|
closeInputStream
public static InputStream closeInputStream(InputStream in)
Closes an input stream.
in
- The stream to close.
- null unless an exception was thrown while closing, else
returns the stream
closeOutputStream
public static OutputStream closeOutputStream(OutputStream out)
Closes an output stream.
out
- The stream to close.
- null unless an exception was thrown while closing, else
returns the stream.
copyStream
public static void copyStream(InputStream in,
OutputStream out)
throws IOException
Copies bytes from input stream into the output stream. Stops
when the input stream read method returns -1. Does not close
the streams.
createByteArrayFromInputStream
public static byte[] createByteArrayFromInputStream(InputStream in)
throws IOException
Returns an array that contains values read from the
given input stream.
moveFile
public static void moveFile(File sourceFile,
File destinationFile)
throws IOException
Moves a file from one location to other.