예제 #1
0
 private byte[] LzoDecompress(byte[] data, Int32 decompressedLength)
 {
     byte[] buf = lzo.DecompressRaw(data, decompressedLength);
     if (buf.Length == decompressedLength)
     {
         return(buf);
     }
     else
     {
         throw new InvalidDataException("解压LZO时出错: 长度有误");
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            LZOCompressor comp = new LZOCompressor();

            byte[] input         = File.ReadAllBytes(@"C:\Users\WHC\Desktop\rubbish\1.bin");
            int    decompressLen = 0x15D6;

            byte[] output = comp.DecompressRaw(input, decompressLen);
            Console.WriteLine(output.Length);
            string strResult = Encoding.GetEncoding(936).GetString(output);

            Console.WriteLine(strResult);
            Console.ReadKey();
        }