Class Compressor
- Namespace
- Renci.SshNet.Compression
- Assembly
- Renci.SshNet.dll
Represents base class for compression algorithm implementation.
public abstract class Compressor : Algorithm, IDisposable
Inheritance
Derived
Implements
Inherited Members
Constructors
Compressor(bool)
Initializes a new instance of the Renci.SshNet.Compression.Compressor class.
protected Compressor(bool delayedCompression)
Parameters
delayedCompression
bool-
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
data
byte[]-
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
data
byte[]-
Data to compress.
offset
int-
The zero-based byte offset in
data
at which to begin reading the data to compress. length
int-
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
data
byte[]-
Data to compress.
offset
int-
The zero-based byte offset in
data
at which to begin reading the data to compress. length
int-
The number of bytes to be compressed.
Returns
- byte[]
-
The compressed data.
Decompress(byte[])
Decompresses the specified data.
public byte[] Decompress(byte[] data)
Parameters
data
byte[]-
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
data
byte[]-
Compressed data.
offset
int-
The zero-based byte offset in
data
at which to begin reading the data to decompress. length
int-
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
data
byte[]-
Compressed data.
offset
int-
The zero-based byte offset in
data
at which to begin reading the data to decompress. length
int-
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
disposing
bool-
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
session
Session-
The session.