NET SFTP Library
CompressBytes Method
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP 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 SFTP
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
SFTP sftp = new SFTP(); //Trial Mode            
            //SFTP sftp = new SFTP("place user name here", "place license key here");
             
            byte[] input = System.Text.ASCIIEncoding.ASCII.GetBytes(string.Empty.PadRight(8000, '*'));           
            byte[] results = sftp.CompressBytes(KellermanSoftware.EncryptionLibrary.CompressionType.GZip, input);
             
            Console.WriteLine("Compressed from {0} to {1}", input.Length, results.Length);
Dim sftp As SFTP = New SFTP() 'Trial Mode
            'Dim sftp As SFTP = New SFTP("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() = sftp.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

SFTP Class
SFTP Members