## org.apache.hadoop.io.compress
Class GzipCodec.GzipOutputStream

    java.lang.Object
      java.io.OutputStream
          org.apache.hadoop.io.compress.CompressionOutputStream
              org.apache.hadoop.io.compress.CompressorStream
                  org.apache.hadoop.io.compress.GzipCodec.GzipOutputStream

All Implemented Interfaces:
  Closeable, Flushable

Enclosing class:
  GzipCodec

    protected static class GzipCodec.GzipOutputStream

extends CompressorStream

A bridge that wraps around a DeflaterOutputStream to make it a CompressionOutputStream.

Field Summary

Fields inherited from class org.apache.hadoop.io.compress.CompressorStream
`buffer, closed, compressor`

Fields inherited from class org.apache.hadoop.io.compress.CompressionOutputStream
`out`

Constructor Summary
`protected` `GzipCodec.GzipOutputStream(CompressorStream out)` Allow children types to put a different type in here.
`` `GzipCodec.GzipOutputStream(OutputStream out)`

Method Summary
`void` `close()`
`void` `finish()` Finishes writing compressed data to the output stream without closing the underlying stream.
`void` `flush()`
`void` `resetState()` Reset the compression to the initial state.
`void` `write(byte[] data, int offset, int length)` Write compressed bytes to the stream.
`void` `write(int b)`

Methods inherited from class org.apache.hadoop.io.compress.CompressorStream
`compress`

Methods inherited from class java.io.OutputStream
`write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GzipCodec.GzipOutputStream

    public GzipCodec.GzipOutputStream(OutputStream out)
                               throws IOException

Throws:
  `IOException`

### GzipCodec.GzipOutputStream

    protected GzipCodec.GzipOutputStream(CompressorStream out)

  Allow children types to put a different type in here.

  Parameters:
    `out` - the Deflater stream to use

Method Detail

### close

    public void close()
               throws IOException

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

### flush

    public void flush()
               throws IOException

  Specified by:
    `flush` in interface `Flushable`
  Overrides:
    `flush` in class `CompressionOutputStream`
  Throws:
    `IOException`

### write

    public void write(int b)
               throws IOException

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

### write

    public void write(byte[] data,
                      int offset,
                      int length)
               throws IOException

  Description copied from class: `CompressionOutputStream`
  Write compressed bytes to the stream. Made abstract to prevent leakage to underlying stream.

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

### finish

    public void finish()
                throws IOException

  Description copied from class: `CompressionOutputStream`
  Finishes writing compressed data to the output stream without closing the underlying stream.

  Overrides:
    `finish` in class `CompressorStream`
  Throws:
    `IOException`

### resetState

    public void resetState()
                    throws IOException

  Description copied from class: `CompressionOutputStream`
  Reset the compression to the initial state. Does not reset the underlying stream.

  Overrides:
    `resetState` in class `CompressorStream`
  Throws:
    `IOException`

Copyright © 2009 The Apache Software Foundation