# Class DeflaterOutputStream

java.lang.Object
java.io.OutputStream
com.codename1.io.gzip.FilterOutputStream
com.codename1.io.gzip.DeflaterOutputStream

All Implemented Interfaces:
  `java.io.Closeable, java.io.Flushable, AutoCloseable`

Direct Known Subclasses:
  `GZIPOutputStream`

public class DeflaterOutputStream extends FilterOutputStream

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected byte[]`
  `buffer`
  `protected static final int`
  `DEFAULT_BUFSIZE`
  `protected final Deflater`
  `deflater`
  `protected boolean`
  `mydeflater`

  ### Fields inherited from class FilterOutputStream

  `out`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DeflaterOutputStream(java.io.OutputStream out)`
  `DeflaterOutputStream(java.io.OutputStream out, Deflater def)`
  `DeflaterOutputStream(java.io.OutputStream out, Deflater deflater, int size)`
  `DeflaterOutputStream(java.io.OutputStream out, Deflater deflater, int size, boolean closeOut)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `protected int`
  `deflate(int flush)`
  `void`
  `finish()`
  `void`
  `flush()`
  `Deflater`
  `getDeflater()`
  `boolean`
  `getSyncFlush()`
  `long`
  `getTotalIn()`
  `long`
  `getTotalOut()`
  `void`
  `setSyncFlush(boolean syncFlush)`
  `void`
  `write(byte[] b, int off, int len)`
  `void`
  `write(int b)`

  ### Methods inherited from class FilterOutputStream

  `write`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### DEFAULT_BUFSIZE

    protected static final int DEFAULT_BUFSIZE
    See Also:
      - Constant Field Values

  - ### deflater

    protected final Deflater deflater

  - ### buffer

    protected byte[] buffer

  - ### mydeflater

    protected boolean mydeflater

- ## Constructor Details

  - ### DeflaterOutputStream

    public DeflaterOutputStream(java.io.OutputStream out) throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### DeflaterOutputStream

    public DeflaterOutputStream(java.io.OutputStream out, Deflater def) throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### DeflaterOutputStream

    public DeflaterOutputStream(java.io.OutputStream out, Deflater deflater, int size) throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### DeflaterOutputStream

    public DeflaterOutputStream(java.io.OutputStream out, Deflater deflater, int size, boolean closeOut) throws java.io.IOException
    Throws:
      `java.io.IOException`

- ## Method Details

  - ### write

    public void write(int b) throws java.io.IOException
    Overrides:
      `write` in class `FilterOutputStream`
    Throws:
      `java.io.IOException`

  - ### write

    public void write(byte[] b, int off, int len) throws java.io.IOException
    Overrides:
      `write` in class `FilterOutputStream`
    Throws:
      `java.io.IOException`

  - ### finish

    public void finish() throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### close

    public void close() throws java.io.IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `java.io.Closeable`
    Overrides:
      `close` in class `FilterOutputStream`
    Throws:
      `java.io.IOException`

  - ### deflate

    protected int deflate(int flush) throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### flush

    public void flush() throws java.io.IOException
    Specified by:
      `flush` in interface `java.io.Flushable`
    Overrides:
      `flush` in class `FilterOutputStream`
    Throws:
      `java.io.IOException`

  - ### getTotalIn

    public long getTotalIn()

  - ### getTotalOut

    public long getTotalOut()

  - ### getSyncFlush

    public boolean getSyncFlush()

  - ### setSyncFlush

    public void setSyncFlush(boolean syncFlush)

  - ### getDeflater

    public Deflater getDeflater()