NET SFTP Library
DecompressBytes Method
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class : DecompressBytes Method
Decompress the passed bytes using the specified compression type
Syntax
'Declaration
 
Public Function DecompressBytes( _
   ByVal compressionType As CompressionType, _
   ByVal input() As System.Byte _
) As System.Byte()
'Usage
 
Dim instance As SFTP
Dim compressionType As CompressionType
Dim input() As System.Byte
Dim value() As System.Byte
 
value = instance.DecompressBytes(compressionType, input)
public System.byte[] DecompressBytes( 
   CompressionType compressionType,
   System.byte[] input
)
public function DecompressBytes( 
    compressionType: CompressionType;
    input: System.Bytearray of
): System.array of Byte; 
public function DecompressBytes( 
   compressionType : CompressionType,
   input : System.byte[]
) : System.byte[];
public: System.byte[]* DecompressBytes( 
   CompressionType compressionType,
   System.byte[]* input
) 
public:
System.array<byte>^ DecompressBytes( 
   CompressionType compressionType,
   System.array<byte>^ input
) 

Parameters

compressionType
input
Example
SFTP sftp = new SFTP(); //Trial Mode            
            //SFTP sftp = new SFTP("place user name here", "place license key here");
             
            string originalString = string.Empty.PadRight(8000, '*');
            byte[] input = System.Text.ASCIIEncoding.ASCII.GetBytes(originalString);
             
            encrypted = sftp.CompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, input);
            decrypted = sftp.DecompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, encrypted);
            string decryptedString = System.Text.ASCIIEncoding.ASCII.GetString(decrypted);
             
            Console.WriteLine("The strings are equal : {0}", originalString == decryptedString);
Dim sftp As SFTP = New SFTP() 'Trial Mode
            'Dim sftp As SFTP = New SFTP("place user name here", "place license key here");
             
            Dim originalString As String = String.Empty.PadRight(8000, "*"c)
            Dim Input As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(originalString)
             
            encrypted = sftp.CompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, Input)
            decrypted = sftp.DecompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, encrypted)
            Dim decryptedString As String = System.Text.ASCIIEncoding.ASCII.GetString(decrypted)
             
            Console.WriteLine("The strings are equal : {0}", originalString = decryptedString)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFTP Class
SFTP Members