# ZlibCompression (sshj 0.4.0 API)
Date: 2011-06-06

## net.schmizz.sshj.transport.compression
Class ZlibCompression

    java.lang.Object
      net.schmizz.sshj.transport.compression.ZlibCompression

All Implemented Interfaces:
  Compression

Direct Known Subclasses:
  DelayedZlibCompression

    public class ZlibCompression

extends Object
implements Compression

ZLib based Compression.

Nested Class Summary
`static class` `ZlibCompression.Factory` Named factory for the ZLib Compression.

Nested classes/interfaces inherited from interface net.schmizz.sshj.transport.compression.Compression
`Compression.Mode`

Constructor Summary
`ZlibCompression()`

Method Summary
`void` `compress(Buffer buffer)` Compress the given buffer in place.
`void` `init(Compression.Mode mode)` Initialize this object to either compress or uncompress data.
`boolean` `isDelayed()` Delayed compression is an Open-SSH specific feature which informs both the client and server to not compress data before the session has been authenticated.
`void` `uncompress(Buffer from, Buffer to)` Uncompress the data in a buffer into another buffer.

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

Constructor Detail

### ZlibCompression

    public ZlibCompression()

Method Detail

### init

    public void init(Compression.Mode mode)

  Description copied from interface: `Compression`
  Initialize this object to either compress or uncompress data. This method must be called prior to any calls to either `compress` or `uncompress`. Once the object has been initialized, only one of `compress` or `uncompress` method can be called.

  Specified by:
    `init` in interface `Compression`

### isDelayed

    public boolean isDelayed()

  Description copied from interface: `Compression`
  Delayed compression is an Open-SSH specific feature which informs both the client and server to not compress data before the session has been authenticated.

  Specified by:
    `isDelayed` in interface `Compression`
  Returns:
    if the compression is delayed after authentication or not

### compress

    public void compress(Buffer buffer)

  Description copied from interface: `Compression`
  Compress the given buffer in place.

  Specified by:
    `compress` in interface `Compression`
  Parameters:
    `buffer` - the buffer containing the data to compress s

### uncompress

    public void uncompress(Buffer from,
                           Buffer to)
                    throws TransportException

  Description copied from interface: `Compression`
  Uncompress the data in a buffer into another buffer.

  Specified by:
    `uncompress` in interface `Compression`
  Parameters:
    `from` - the buffer containing the data to uncompress
    `to` - the buffer receiving the uncompressed data
  Throws:
    `TransportException`

Copyright © 2009-2011. All Rights Reserved.