Top Description Fields Constructors Methods
org.apache.sshd.common.compression

public Class CompressionZlib

extends BaseCompression
Class Inheritance
Known Direct Subclasses
org.apache.sshd.common.compression.CompressionDelayedZlib
Imports
java.io.IOException, java.util.zip.DataFormatException, .Deflater, .Inflater, org.apache.sshd.common.util.buffer.Buffer

ZLib based Compression.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private static final int
private Deflater
private Inflater
private byte[]

Constructor Summary

AccessConstructor and Description
public
CompressionZlib()

Create a new instance of a ZLib base compression

protected

Method Summary

Modifier and TypeMethod and Description
public void
compress(Buffer
the buffer containing the data to compress
buffer
)

Implements org.apache.sshd.common.compression.Compression.compress.

Compress the given buffer in place.

public void
init(Compression.Type
compression type
type
,
int
compression level
level
)

Implements org.apache.sshd.common.compression.Compression.init.

Initialize this object to either compress or uncompress data.

public boolean
isDelayed()

Implements org.apache.sshd.common.compression.CompressionInformation.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.

public void
uncompress(Buffer
the buffer containing the data to uncompress
from
,
Buffer
the buffer receiving the uncompressed data
to
)

Implements org.apache.sshd.common.compression.Compression.uncompress.

Uncompress the data in a buffer into another buffer.

Inherited from org.apache.sshd.common.compression.BaseCompression:
getNameisCompressionExecutedtoString

Field Detail

BUF_SIZEback to summary
private static final int BUF_SIZE
compresserback to summary
private Deflater compresser
decompresserback to summary
private Inflater decompresser
tmpbufback to summary
private byte[] tmpbuf

Constructor Detail

CompressionZlibback to summary
public CompressionZlib()

Create a new instance of a ZLib base compression

CompressionZlibback to summary
protected CompressionZlib(String name)

Method Detail

compressback to summary
public void compress(Buffer buffer) throws IOException

Implements org.apache.sshd.common.compression.Compression.compress.

Doc from org.apache.sshd.common.compression.Compression.compress.

Compress the given buffer in place.

Parameters
buffer:Buffer

the buffer containing the data to compress

Annotations
@Override
Exceptions
IOException:
if an error occurs
initback to summary
public void init(Compression.Type type, int level)

Implements org.apache.sshd.common.compression.Compression.init.

Doc from org.apache.sshd.common.compression.Compression.init.

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.

Parameters
type:Compression.Type

compression type

level:int

compression level

Annotations
@Override
isDelayedback to summary
public boolean isDelayed()

Implements org.apache.sshd.common.compression.CompressionInformation.isDelayed.

Doc from org.apache.sshd.common.compression.CompressionInformation.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.

Returns:boolean

if the compression is delayed after authentication or not

Annotations
@Override
uncompressback to summary
public void uncompress(Buffer from, Buffer to) throws IOException

Implements org.apache.sshd.common.compression.Compression.uncompress.

Doc from org.apache.sshd.common.compression.Compression.uncompress.

Uncompress the data in a buffer into another buffer.

Parameters
from:Buffer

the buffer containing the data to uncompress

to:Buffer

the buffer receiving the uncompressed data

Annotations
@Override
Exceptions
IOException:
if an error occurs