org.apache.sshd.common.compression
Class CompressionZlib

java.lang.Object
  extended by org.apache.sshd.common.compression.CompressionZlib
All Implemented Interfaces:
Compression
Direct Known Subclasses:
CompressionDelayedZlib

public class CompressionZlib
extends Object
implements Compression

ZLib based Compression.

Author:
Apache MINA SSHD Project

Nested Class Summary
static class CompressionZlib.Factory
          Named factory for the ZLib Compression.
 
Nested classes/interfaces inherited from interface org.apache.sshd.common.Compression
Compression.Type
 
Constructor Summary
CompressionZlib()
          Create a new instance of a ZLib base compression
 
Method Summary
 void compress(Buffer buffer)
          Compress the given buffer in place.
 void init(Compression.Type type, int level)
          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

CompressionZlib

public CompressionZlib()
Create a new instance of a ZLib base compression

Method Detail

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

init

public void init(Compression.Type type,
                 int level)
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 methods can be called.

Specified by:
init in interface Compression

compress

public void compress(Buffer buffer)
              throws IOException
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
Throws:
IOException - if an error occurs

uncompress

public void uncompress(Buffer from,
                       Buffer to)
                throws IOException
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:
IOException - if an error occurs


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.