net.sourceforge.cobertura.util

Class IOUtil


public abstract class IOUtil
extends java.lang.Object

Helper class with useful I/O operations.

Author:
Grzegorz Lukasik

Field Summary

private static Logger
logger

Method Summary

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.

Field Details

logger

private static final Logger logger

Method Details

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.