Package: org.apache.groovy.json.internal

## [Java] Class IO

- org.apache.groovy.json.internal.IO

-     public class IO
      extends Object

  Reader and writer helpers used by the JSON parser internals.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static int` | `copy(Reader input, Writer output)` Copies all characters from a reader to a writer.
    `` | `public static long` | `copyLarge(Reader reader, Writer writer)` Copies all characters from a reader to a writer using the default buffer size.
    `` | `public static long` | `copyLarge(Reader reader, Writer writer, char[] buffer)` Copies all characters from a reader to a writer using the supplied buffer.
    `` | `public static CharBuf` | `read(Reader input, CharBuf charBuf, int bufSize)` Reads all characters from a reader into a recyclable buffer and closes the reader.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static int copy(Reader input, Writer output)

      Copies all characters from a reader to a writer.

      Parameters:
        `input` - reader supplying characters
        `output` - writer receiving characters
      Returns:
        number of copied characters, or `-1` when the count exceeds Integer.MAX_VALUE

    - #### public static long copyLarge(Reader reader, Writer writer)

      Copies all characters from a reader to a writer using the default buffer size.

      Parameters:
        `reader` - reader supplying characters
        `writer` - writer receiving characters
      Returns:
        number of copied characters

    - #### public static long copyLarge(Reader reader, Writer writer, char[] buffer)

      Copies all characters from a reader to a writer using the supplied buffer.

      Parameters:
        `reader` - reader supplying characters
        `writer` - writer receiving characters
        `buffer` - temporary buffer to reuse during copying
      Returns:
        number of copied characters

    - #### public static CharBuf read(Reader input, CharBuf charBuf, int bufSize)

      Reads all characters from a reader into a recyclable buffer and closes the reader.

      Parameters:
        `input` - reader supplying characters
        `charBuf` - existing buffer to reuse, or `null` to allocate one
        `bufSize` - initial buffer size when a new buffer is allocated
      Returns:
        buffer containing the reader contents