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 manually
    static int copy​(FileInputStream in, FileOutputStream out)
    Copies bytes from a FileInputStream to a FileOutputStream.
    static int copy​(InputStream in, OutputStream out, byte[] buffer)
    Copies bytes from an InputStream to an OutputStream via a byte buffer.
    static long copyLarge​(FileInputStream in, FileOutputStream out)
    Copies bytes from a large (over 2GB) FileInputStream to a FileOutputStream.

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IOUtils

      protected IOUtils()
  • Method Details

    • copy

      public static int copy​(FileInputStream in, FileOutputStream out) throws IOException
      Copies bytes from a FileInputStream to a FileOutputStream. This method uses channels. The input file should not be written to during the copy.
      Parameters:
      in - the source
      out - the destination
      Throws:
      IOException - if one occurs while reading or writing
    • copyLarge

      public static long copyLarge​(FileInputStream in, FileOutputStream out) throws IOException
      Copies bytes from a large (over 2GB) FileInputStream to a FileOutputStream. This method uses channels. The input file should not be written to during the copy.
      Parameters:
      in - the source
      out - the destination
      Throws:
      IOException - if one occurs while reading or writing
    • copy

      public static int copy​(InputStream in, OutputStream out, byte[] buffer) throws IOException
      Copies bytes from an InputStream to an OutputStream via a byte buffer. This method buffers input internally, so the input stream should not be a BufferedInputStream.
      Parameters:
      in - the source
      out - the destination
      buffer - the buffer
      Returns:
      the number of bytes copied
      Throws:
      IOException - if one occurs while reading or writing
    • closeQuietly

      @Deprecated public static void closeQuietly​(AutoCloseable c)
      Deprecated.
      use try with resources or close and catch manually
      Close an AutoCloseable unconditionally. Equivalent to calling c.close() when c is nonnull.
      Parameters:
      c - a (possibly null) AutoCloseable