NET FTP Library
CompressBytes Method
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : CompressBytes Method
Compress the passed bytes using the specified compression type
Syntax
'Declaration
 
Public Function CompressBytes( _
   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.CompressBytes(compressionType, input)
public System.byte[] CompressBytes( 
   CompressionType compressionType,
   System.byte[] input
)
public function CompressBytes( 
    compressionType: CompressionType;
    input: System.Bytearray of
): System.array of Byte; 
public function CompressBytes( 
   compressionType : CompressionType,
   input : System.byte[]
) : System.byte[];
public: System.byte[]* CompressBytes( 
   CompressionType compressionType,
   System.byte[]* input
) 
public:
System.array<byte>^ CompressBytes( 
   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");
 
byte[] input = System.Text.ASCIIEncoding.ASCII.GetBytes(string.Empty.PadRight(8000, '*'));           
byte[] results = ftp.CompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, input);
 
Console.WriteLine("Compressed from {0} to {1}", input.Length, results.Length);
Dim ftp As FTP = New FTP() 'Trial Mode
'FTP ftp = new FTP("place user name here", "place license key here");
 
Dim Input As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(String.Empty.PadRight(8000, "*"c))
Dim results As Byte() = ftp.CompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, Input)
 
Console.WriteLine("Compressed from {0} to {1}", Input.Length, results.Length)
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