Class CompressionZlib
java.lang.Object
org.apache.sshd.common.compression.BaseCompression
org.apache.sshd.common.compression.CompressionZlib
- All Implemented Interfaces:
Compression,CompressionInformation,NamedResource
- Direct Known Subclasses:
CompressionDelayedZlib
ZLib based Compression.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sshd.common.compression.Compression
Compression.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate Deflaterprivate Inflaterprivate byte[]Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a new instance of a ZLib base compressionprotectedCompressionZlib(String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidCompress the given buffer in place.voidinit(Compression.Type type, int level) Initialize this object to either compress or uncompress data.booleanDelayed compression is an Open-SSH specific feature which informs both the client and server to not compress data before the session has been authenticated.voiduncompress(Buffer from, Buffer to) Uncompress the data in a buffer into another buffer.Methods inherited from class org.apache.sshd.common.compression.BaseCompression
getName, isCompressionExecuted, toString
-
Field Details
-
BUF_SIZE
private static final int BUF_SIZE- See Also:
-
tmpbuf
private byte[] tmpbuf -
compresser
-
decompresser
-
-
Constructor Details
-
CompressionZlib
public CompressionZlib()Create a new instance of a ZLib base compression -
CompressionZlib
-
-
Method Details
-
isDelayed
public boolean isDelayed()Description copied from interface:CompressionInformationDelayed 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:
- if the compression is delayed after authentication or not
-
init
Description copied from interface:CompressionInitialize this object to either compress or uncompress data. This method must be called prior to any calls to eithercompressoruncompress. Once the object has been initialized, only one ofcompressoruncompressmethods can be called.- Parameters:
type- compression typelevel- compression level
-
compress
Description copied from interface:CompressionCompress the given buffer in place.- Parameters:
buffer- the buffer containing the data to compress- Throws:
IOException- if an error occurs
-
uncompress
Description copied from interface:CompressionUncompress the data in a buffer into another buffer.- Parameters:
from- the buffer containing the data to uncompressto- the buffer receiving the uncompressed data- Throws:
IOException- if an error occurs
-