Package: org.codehaus.groovy.grails.io.support

## [Groovy] Class GrailsIOUtils

- org.codehaus.groovy.grails.io.support.GrailsIOUtils

- Authors:
    Graeme Rocher
  Since:
    2.4

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class IOUtils` | `BUFFER_SIZE`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `static void` | `copy(java.io.InputStream input, java.io.Writer output, java.lang.String encoding = null)` Copy an InputStream to the given writer with the given encoding
    `static java.io.File` | `findJarFile(java.lang.Class targetClass)` Finds a JAR file for the given class
    `static java.io.BufferedInputStream` | `openStream(java.io.File file)` Gracefully opens a stream for a file, throwing exceptions where appropriate.
    `static java.lang.String` | `toString(java.io.Reader reader)` Convert a reader to a String, reading the data from the reader
    `static java.lang.String` | `toString(java.io.InputStream stream, java.lang.String encoding = null)` Convert a stream to a String, reading the data from the stream

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class IOUtils` | `addAll, byteArrayToHexString, closeQuietly, computeChecksum, copy, copy, copy, copy, copy, copy, copyToByteArray, copyToByteArray, copyToString, createXmlSlurper`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Method Detail

    - #### static void copy(java.io.InputStream input, java.io.Writer output, java.lang.String encoding = null)

      Copy an InputStream to the given writer with the given encoding

      Parameters:
        `input` - The input
        `output` - The writer
        `encoding` - The encoding

    - #### static java.io.File findJarFile(java.lang.Class targetClass)

      Finds a JAR file for the given class

      Parameters:
        `targetClass` - The target class
      Returns:
        The JAR file

    - #### static java.io.BufferedInputStream openStream(java.io.File file)

      Gracefully opens a stream for a file, throwing exceptions where appropriate. Based off the commons-io method

      Parameters:
        `file` - The file
      Returns:
        The stream

    - #### static java.lang.String toString(java.io.Reader reader)

      Convert a reader to a String, reading the data from the reader

      Parameters:
        `reader` - The reader
      Returns:
        The string

    - #### static java.lang.String toString(java.io.InputStream stream, java.lang.String encoding = null)

      Convert a stream to a String, reading the data from the stream

      Parameters:
        `stream` - The stream
      Returns:
        The string