net.i2p.i2ptunnel.util

## Class GunzipOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.FilterOutputStream
    - - java.util.zip.InflaterOutputStream
      - - net.i2p.i2ptunnel.util.GunzipOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      public class GunzipOutputStream
      extends InflaterOutputStream

  Gunzip implementation per RFC 1952, reusing java's standard CRC32 and Inflater and InflaterOutputStream implementations. Note that the underlying InflaterOutputStream cannot be reused after close(), so we don't have a Reusable version of this. Sets up GunzipOutputStream -- InflaterOutputStream -- CRC32OutputStream -- uncompressedStream Not a public API, subject to change, not for external use. Modified from net.i2p.util.ResettableGZIPInputStream to use Java 6 InflaterOutputstream

- - ### Field Summary

    - ### Fields inherited from class java.util.zip.InflaterOutputStream

      `buf, inf`

    - ### Fields inherited from class java.io.FilterOutputStream

      `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GunzipOutputStream(OutputStream uncompressedStream)` Build a new Gunzip stream
    `GunzipOutputStream(OutputStream uncompressedStream, LimitOutputStream.DoneCallback cb)` With a callback when done

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `boolean` | `getFinished()` Inflater statistic
    `long` | `getRemaining()` Inflater statistic
    `long` | `getTotalExpanded()` Inflater statistic
    `long` | `getTotalRead()` Inflater statistic
    `String` | `toString()`
    `void` | `write(byte[] buf, int off, int len)`
    `void` | `write(int b)`

    - ### Methods inherited from class java.util.zip.InflaterOutputStream

      `finish, flush`

    - ### Methods inherited from class java.io.FilterOutputStream

      `write`

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

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

- - ### Constructor Detail

    - #### GunzipOutputStream

          public GunzipOutputStream(OutputStream uncompressedStream)
                             throws IOException

      Build a new Gunzip stream
      Throws:
        `IOException`

    - #### GunzipOutputStream

          public GunzipOutputStream(OutputStream uncompressedStream,
                                    LimitOutputStream.DoneCallback cb)
                             throws IOException

      With a callback when done
      Parameters:
        `cb` - may be null
      Throws:
        `IOException`

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `InflaterOutputStream`
      Throws:
        `IOException`

    - #### getFinished

          public boolean getFinished()

      Inflater statistic

    - #### getRemaining

          public long getRemaining()

      Inflater statistic

    - #### getTotalExpanded

          public long getTotalExpanded()

      Inflater statistic

    - #### getTotalRead

          public long getTotalRead()

      Inflater statistic

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### write

          public void write(byte[] buf,
                            int off,
                            int len)
                     throws IOException

      Overrides:
        `write` in class `InflaterOutputStream`
      Throws:
        `IOException`

    - #### write

          public void write(int b)
                     throws IOException

      Overrides:
        `write` in class `InflaterOutputStream`
      Throws:
        `IOException`