C# Class ManagedXZ.XZUtils

Mostrar archivo Open project: goldenbull/ManagedXZ Class Usage Examples

Public Methods

Method Description
CompressBytes ( byte data, int offset, int count, int threads = 1, int level = 6 ) : byte[]

Compress data in-memory

CompressFile ( string inFile, string outFile, FileMode mode = FileMode.Create, int threads = 1, int level = 6 ) : void
DecompressBytes ( byte data, int offset, int count ) : byte[]
DecompressFile ( string inFile, string outFile ) : void

Private Methods

Method Description
CodeBuffer ( lzma_stream _lzma_stream, byte data, int offset, int count ) : byte[]

liblzma has provided lzma_stream_buffer_encode and lzma_stream_buffer_decode, but here I re-invent the wheel again...

CreateEncoder ( lzma_stream stream, int threads, uint preset ) : lzma_ret

Method Details

CompressBytes() public static method

Compress data in-memory
public static CompressBytes ( byte data, int offset, int count, int threads = 1, int level = 6 ) : byte[]
data byte
offset int
count int
threads int
level int 0-9, default is 6, bigger number needs more time and produces smaller compressed data
return byte[]

CompressFile() public static method

public static CompressFile ( string inFile, string outFile, FileMode mode = FileMode.Create, int threads = 1, int level = 6 ) : void
inFile string
outFile string
mode FileMode
threads int
level int
return void

DecompressBytes() public static method

public static DecompressBytes ( byte data, int offset, int count ) : byte[]
data byte
offset int
count int
return byte[]

DecompressFile() public static method

public static DecompressFile ( string inFile, string outFile ) : void
inFile string
outFile string
return void