public class IOUtils extends Object
Constructor and Description |
---|
IOUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyBytes(InputStream is,
OutputStream os)
Reads bytes from the given input stream and writes them to the given output stream until
the end of the input stream is reached.
|
static void |
copyBytesAndClose(InputStream is,
OutputStream os)
Calls
copyBytes(java.io.InputStream, java.io.OutputStream) and safely closes both streams. |
static boolean |
createDir(File dir)
Creates the specified directory.
|
public static void copyBytes(InputStream is, OutputStream os) throws IOException
is
- the input streamos
- the output streamIOException
- if an I/O error occurspublic static void copyBytesAndClose(InputStream is, OutputStream os) throws IOException
copyBytes(java.io.InputStream, java.io.OutputStream)
and safely closes both streams.is
- the input streamos
- the output streamIOException
- if an I/O error occurspublic static boolean createDir(File dir) throws IOException
dir
- the directory to be createdtrue
if it has been created, false
if the directory already existsIOException
- if the directory could not be createdCopyright © 2014–2017 European Space Agency (ESA). All rights reserved.