Class Compressor
- Namespace
- Renci.SshNet.Compression
- Assembly
- Renci.SshNet.dll
Represents base class for compression algorithm implementation.
public abstract class Compressor : Algorithm, IDisposableInheritance
Derived
Implements
Inherited Members
Constructors
Compressor(bool)
Initializes a new instance of the Renci.SshNet.Compression.Compressor class.
protected Compressor(bool delayedCompression)Parameters
delayedCompressionbool-
false to start compression after receiving SSH_MSG_NEWKEYS. true to delay compression until SSH_MSG_USERAUTH_SUCCESS is received. See https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt.
Methods
Compress(byte[])
Compresses the specified data.
public byte[] Compress(byte[] data)Parameters
databyte[]-
Data to compress.
Returns
- byte[]
-
The compressed data.
Compress(byte[], int, int)
Compresses the specified data.
public virtual byte[] Compress(byte[] data, int offset, int length)Parameters
databyte[]-
Data to compress.
offsetint-
The zero-based byte offset in
dataat which to begin reading the data to compress. lengthint-
The number of bytes to be compressed.
Returns
- byte[]
-
The compressed data.
CompressCore(byte[], int, int)
Compresses the specified data.
protected abstract byte[] CompressCore(byte[] data, int offset, int length)Parameters
databyte[]-
Data to compress.
offsetint-
The zero-based byte offset in
dataat which to begin reading the data to compress. lengthint-
The number of bytes to be compressed.
Returns
- byte[]
-
The compressed data.
Decompress(byte[])
Decompresses the specified data.
public byte[] Decompress(byte[] data)Parameters
databyte[]-
Compressed data.
Returns
- byte[]
-
The decompressed data.
Decompress(byte[], int, int)
Decompresses the specified data.
public virtual byte[] Decompress(byte[] data, int offset, int length)Parameters
databyte[]-
Compressed data.
offsetint-
The zero-based byte offset in
dataat which to begin reading the data to decompress. lengthint-
The number of bytes to be read from the compressed data.
Returns
- byte[]
-
The decompressed data.
DecompressCore(byte[], int, int)
Decompresses the specified data.
protected abstract byte[] DecompressCore(byte[] data, int offset, int length)Parameters
databyte[]-
Compressed data.
offsetint-
The zero-based byte offset in
dataat which to begin reading the data to decompress. lengthint-
The number of bytes to be read from the compressed data.
Returns
- byte[]
-
The decompressed data.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposingbool-
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Init(Session)
Initializes the algorithm.
public virtual void Init(Session session)Parameters
sessionSession-
The session.