public class CompressionZlib extends BaseCompression
Compression.Type
Modifier and Type | Field and Description |
---|---|
private static int |
BUF_SIZE |
private java.util.zip.Deflater |
compresser |
private java.util.zip.Inflater |
decompresser |
private byte[] |
tmpbuf |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Modifier | Constructor and Description |
---|---|
|
CompressionZlib()
Create a new instance of a ZLib base compression
|
protected |
CompressionZlib(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
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.
|
getName, isCompressionExecuted, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findByName, getNameList, getNames, removeByName
private static final int BUF_SIZE
private byte[] tmpbuf
private java.util.zip.Deflater compresser
private java.util.zip.Inflater decompresser
public CompressionZlib()
protected CompressionZlib(java.lang.String name)
public boolean isDelayed()
CompressionInformation
public void init(Compression.Type type, int level)
Compression
compress
or uncompress
.
Once the object has been initialized, only one of
compress
or uncompress
methods can be
called.type
- compression typelevel
- compression levelpublic void compress(Buffer buffer) throws java.io.IOException
Compression
buffer
- the buffer containing the data to compressjava.io.IOException
- if an error occurspublic void uncompress(Buffer from, Buffer to) throws java.io.IOException
Compression
from
- the buffer containing the data to uncompressto
- the buffer receiving the uncompressed datajava.io.IOException
- if an error occurs