Net Encryption Library
DecompressBytes Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption 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 Encryption
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
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
byte[] input = new byte[1024];
 
for (int i = 0; i < 1024; i++)
    input[i] = 5;
 
byte[] compressedBytes = encryption.CompressBytes(CompressionType.GZip, input);
Console.WriteLine("{0} bytes compressed to {1} bytes with GZIP", input.Length, compressedBytes.Length);
byte[] decompressedBytes = encryption.DecompressBytes(CompressionType.GZip, compressedBytes);
 
compressedBytes = encryption.CompressBytes(CompressionType.Deflate, input);
Console.WriteLine("{0} bytes compressed to {1} bytes with Deflate", input.Length, compressedBytes.Length);
decompressedBytes = encryption.DecompressBytes(CompressionType.Deflate, compressedBytes);
 
compressedBytes = encryption.CompressBytes(CompressionType.MiniLZO, input);
Console.WriteLine("{0} bytes compressed to {1} bytes with MiniLZO", input.Length, compressedBytes.Length);
decompressedBytes = encryption.DecompressBytes(CompressionType.MiniLZO, compressedBytes);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
Dim input(1023) As Byte
 
For i As Integer = 0 To 1023
    input(i) = 5
Next i
 
Dim compressedBytes() As Byte = encryption.CompressBytes(CompressionType.GZip, input)
Console.WriteLine("{0} bytes compressed to {1} bytes with GZIP", input.Length, compressedBytes.Length)
Dim decompressedBytes() As Byte = encryption.DecompressBytes(CompressionType.GZip, compressedBytes)
 
compressedBytes = encryption.CompressBytes(CompressionType.Deflate, input)
Console.WriteLine("{0} bytes compressed to {1} bytes with Deflate", input.Length, compressedBytes.Length)
decompressedBytes = encryption.DecompressBytes(CompressionType.Deflate, compressedBytes)
 
compressedBytes = encryption.CompressBytes(CompressionType.MiniLZO, input)
Console.WriteLine("{0} bytes compressed to {1} bytes with MiniLZO", input.Length, compressedBytes.Length)
decompressedBytes = encryption.DecompressBytes(CompressionType.MiniLZO, compressedBytes)
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

Encryption Class
Encryption Members