Class IOUtils


  • class IOUtils
    extends java.lang.Object
    Copied from Apache Commons IO.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int DEFAULT_BUFFER_SIZE
      Copied from Apache Commons IO.
      private static int EOF
      Copied from Apache Commons IO.
    • Constructor Summary

      Constructors 
      Constructor Description
      IOUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static long copy​(java.io.Reader input, java.lang.Appendable output)
      Copies chars from a large (over 2GB) Reader to an Appendable.
      (package private) static long copy​(java.io.Reader input, java.lang.Appendable output, java.nio.CharBuffer buffer)
      Copies chars from a large (over 2GB) Reader to an Appendable.
      (package private) static long copyLarge​(java.io.Reader input, java.io.Writer output)
      Copied from Apache Commons IO.
      (package private) static long copyLarge​(java.io.Reader input, java.io.Writer output, char[] buffer)
      Copied from Apache Commons IO.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_BUFFER_SIZE

        static final int DEFAULT_BUFFER_SIZE

        Copied from Apache Commons IO.

        The default buffer size (4096).
        See Also:
        Constant Field Values
      • EOF

        private static final int EOF

        Copied from Apache Commons IO.

        Represents the end-of-file (or stream).
        Since:
        2.5 (made public)
        See Also:
        Constant Field Values
    • Constructor Detail

      • IOUtils

        IOUtils()
    • Method Detail

      • copy

        static long copy​(java.io.Reader input,
                         java.lang.Appendable output)
                  throws java.io.IOException
        Copies chars from a large (over 2GB) Reader to an Appendable.

        This method buffers the input internally, so there is no need to use a BufferedReader.

        The buffer size is given by DEFAULT_BUFFER_SIZE.
        Parameters:
        input - the Reader to read from
        output - the Appendable to append to
        Returns:
        the number of characters copied
        Throws:
        java.lang.NullPointerException - if the input or output is null
        java.io.IOException - if an I/O error occurs
        Since:
        2.7
      • copy

        static long copy​(java.io.Reader input,
                         java.lang.Appendable output,
                         java.nio.CharBuffer buffer)
                  throws java.io.IOException
        Copies chars from a large (over 2GB) Reader to an Appendable.

        This method uses the provided buffer, so there is no need to use a BufferedReader.

        Parameters:
        input - the Reader to read from
        output - the Appendable to write to
        buffer - the buffer to be used for the copy
        Returns:
        the number of characters copied
        Throws:
        java.lang.NullPointerException - if the input or output is null
        java.io.IOException - if an I/O error occurs
        Since:
        2.7
      • copyLarge

        static long copyLarge​(java.io.Reader input,
                              java.io.Writer output)
                       throws java.io.IOException

        Copied from Apache Commons IO.

        Copies chars from a large (over 2GB) Reader to a Writer.

        This method buffers the input internally, so there is no need to use a BufferedReader.

        The buffer size is given by DEFAULT_BUFFER_SIZE.

        Parameters:
        input - the Reader to read from
        output - the Writer to write to
        Returns:
        the number of characters copied
        Throws:
        java.lang.NullPointerException - if the input or output is null
        java.io.IOException - if an I/O error occurs
        Since:
        1.3
      • copyLarge

        static long copyLarge​(java.io.Reader input,
                              java.io.Writer output,
                              char[] buffer)
                       throws java.io.IOException

        Copied from Apache Commons IO.

        Copies chars from a large (over 2GB) Reader to a Writer.

        This method uses the provided buffer, so there is no need to use a BufferedReader.

        Parameters:
        input - the Reader to read from
        output - the Writer to write to
        buffer - the buffer to be used for the copy
        Returns:
        the number of characters copied
        Throws:
        java.lang.NullPointerException - if the input or output is null
        java.io.IOException - if an I/O error occurs
        Since:
        2.2