net.sf.okapi.common

## Class StreamUtil

- java.lang.Object
- - net.sf.okapi.common.StreamUtil

-     public class StreamUtil
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `calcCRC(java.io.InputStream in)`
    `static void` | `copy(java.io.File in, java.io.File out)`
    `static void` | `copy(java.io.File in, java.io.OutputStream out)`
    `static void` | `copy(java.io.InputStream in, java.io.File out)`
    `static void` | `copy(java.io.InputStream in, java.io.OutputStream out)`
    `static byte[]` | `inputStreamToBytes(java.io.InputStream in)` Reads an InputStream into an array of bytes.
    `static java.lang.String` | `streamAsString(java.io.InputStream in)`
    `static java.lang.String` | `streamAsString(java.io.InputStream in, java.lang.String encoding)`
    `static java.io.InputStream` | `stringAsStream(java.lang.String str)`
    `static java.io.InputStream` | `stringAsStream(java.lang.String str, java.lang.String encoding)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StreamUtil

          public StreamUtil()

  - ### Method Detail

    - #### inputStreamToBytes

          public static byte[] inputStreamToBytes(java.io.InputStream in)
                                           throws java.io.IOException

      Reads an InputStream into an array of bytes.
      Parameters:
        `in` - the input stream to read.
      Returns:
        the array of bytes read.
      Throws:
        `java.io.IOException` - if an error occurs.

    - #### copy

          public static void copy(java.io.InputStream in,
                  java.io.OutputStream out)

    - #### copy

          public static void copy(java.io.File in,
                  java.io.OutputStream out)

    - #### copy

          public static void copy(java.io.InputStream in,
                  java.io.File out)

    - #### copy

          public static void copy(java.io.File in,
                  java.io.File out)

    - #### streamAsString

          public static java.lang.String streamAsString(java.io.InputStream in,
                                        java.lang.String encoding)

    - #### streamAsString

          public static java.lang.String streamAsString(java.io.InputStream in)

    - #### stringAsStream

          public static java.io.InputStream stringAsStream(java.lang.String str)

    - #### stringAsStream

          public static java.io.InputStream stringAsStream(java.lang.String str,
                                           java.lang.String encoding)

    - #### calcCRC

          public static long calcCRC(java.io.InputStream in)