Package VASSAL.tools.io
Class IOUtils
java.lang.Object
org.apache.commons.io.IOUtils
VASSAL.tools.io.IOUtils
public class IOUtils
extends org.apache.commons.io.IOUtils
General I/O stream manipulation utilities. This class provides static
utility methods to reduce boilerplate I/O code.
- Since:
- 3.1.0
- Author:
- Joel Uckelman
-
Field Summary
Fields inherited from class org.apache.commons.io.IOUtils
DEFAULT_BUFFER_SIZE, DIR_SEPARATOR, DIR_SEPARATOR_UNIX, DIR_SEPARATOR_WINDOWS, EOF, LINE_SEPARATOR, LINE_SEPARATOR_UNIX, LINE_SEPARATOR_WINDOWS
-
Constructor Summary
Constructors Modifier Constructor Description protected
IOUtils()
-
Method Summary
Modifier and Type Method Description static void
closeQuietly(AutoCloseable c)
Deprecated.use try with resources or close and catch manuallystatic int
copy(FileInputStream in, FileOutputStream out)
Copies bytes from aFileInputStream
to aFileOutputStream
.static int
copy(InputStream in, OutputStream out, byte[] buffer)
Copies bytes from anInputStream
to anOutputStream
via abyte
buffer.static long
copyLarge(FileInputStream in, FileOutputStream out)
Copies bytes from a large (over 2GB)FileInputStream
to aFileOutputStream
.Methods inherited from class org.apache.commons.io.IOUtils
buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, close, close, close, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, contentEquals, contentEquals, contentEqualsIgnoreEOL, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, length, length, length, length, lineIterator, lineIterator, lineIterator, read, read, read, read, read, readFully, readFully, readFully, readFully, readFully, readFully, readLines, readLines, readLines, readLines, resourceToByteArray, resourceToByteArray, resourceToString, resourceToString, resourceToURL, resourceToURL, skip, skip, skip, skipFully, skipFully, skipFully, toBufferedInputStream, toBufferedInputStream, toBufferedReader, toBufferedReader, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toCharArray, toCharArray, toCharArray, toCharArray, toInputStream, toInputStream, toInputStream, toInputStream, toInputStream, toInputStream, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, writeChunked, writeChunked, writeLines, writeLines, writeLines, writeLines, writer
-
Constructor Details
-
IOUtils
protected IOUtils()
-
-
Method Details
-
copy
Copies bytes from aFileInputStream
to aFileOutputStream
. This method uses channels. The input file should not be written to during the copy.- Parameters:
in
- the sourceout
- the destination- Throws:
IOException
- if one occurs while reading or writing
-
copyLarge
Copies bytes from a large (over 2GB)FileInputStream
to aFileOutputStream
. This method uses channels. The input file should not be written to during the copy.- Parameters:
in
- the sourceout
- the destination- Throws:
IOException
- if one occurs while reading or writing
-
copy
Copies bytes from anInputStream
to anOutputStream
via abyte
buffer. This method buffers input internally, so the input stream should not be aBufferedInputStream
.- Parameters:
in
- the sourceout
- the destinationbuffer
- the buffer- Returns:
- the number of bytes copied
- Throws:
IOException
- if one occurs while reading or writing
-
closeQuietly
Deprecated.use try with resources or close and catch manually- Parameters:
c
- a (possiblynull
)AutoCloseable
-