Пример #1
0
 /// <summary>
 /// Compress source into dest returning compressed length
 /// </summary>
 /// <param name="source">uncompressed data</param>
 /// <param name="srcOffset">offset in source array where reading will start</param>
 /// <param name="count">count of bytes in source array to compress</param>
 /// <param name="dest">array into which source will be compressed</param>
 /// <param name="dstOffset">start index in dest array where writing will start</param>
 /// <returns>compressed length</returns>
 public static int Compress(byte[] source, int srcOffset, int count, byte[] dest, int dstOffset)
 {
     return(LZ4CompressorFactory.CreateNew().Compress(source, srcOffset, count, dest, dstOffset));
 }
Пример #2
0
 /// <summary>
 /// Calculate the max compressed byte[] size given the size of the uncompressed byte[]
 /// </summary>
 /// <param name="uncompressedLength">Length of the uncompressed data</param>
 /// <returns>The maximum required size in bytes of the compressed data</returns>
 public static int CalculateMaxCompressedLength(int uncompressedLength)
 {
     return(LZ4CompressorFactory.CreateNew().CalculateMaxCompressedLength(uncompressedLength));
 }
Пример #3
0
 /// <summary>
 /// Compress source into dest returning compressed length
 /// </summary>
 /// <param name="source">uncompressed data</param>
 /// <param name="dest">array into which source will be compressed</param>
 /// <returns>compressed length</returns>
 public static int Compress(byte[] source, byte[] dest)
 {
     return(LZ4CompressorFactory.CreateNew().Compress(source, dest));
 }
Пример #4
0
 public static byte[] Compress(byte[] source)
 {
     return(LZ4CompressorFactory.CreateNew().Compress(source));
 }