NET FTP Library
DecompressBytes Method
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP 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 FTP
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
FTP ftp = new FTP(); //Trial Mode            
//FTP ftp = new FTP("place user name here", "place license key here");
 
string originalString = string.Empty.PadRight(8000, '*');
byte[] input = System.Text.ASCIIEncoding.ASCII.GetBytes(originalString);
 
encrypted = ftp.CompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, input);
decrypted = ftp.DecompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, encrypted);
string decryptedString = System.Text.ASCIIEncoding.ASCII.GetString(decrypted);
 
Console.WriteLine("The strings are equal : {0}", originalString == decryptedString);
Dim ftp As FTP = New FTP() 'Trial Mode
'FTP ftp = new FTP("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 = ftp.CompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, Input)
decrypted = ftp.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

FTP Class
FTP Members