()
| 46 | } |
| 47 | |
| 48 | public static void Test1() |
| 49 | { |
| 50 | var bc = new BufferCodec(); |
| 51 | var c = new Compress(new Encrypt(bc, new byte[1] { 1 })); |
| 52 | var r = new Random(1234); |
| 53 | var s = new byte[1024 * 1024 * 2]; |
| 54 | for (int i = 0; i < s.Length; i++) |
| 55 | s[i] = (byte)r.Next(16); |
| 56 | c.update(s, 0, s.Length); |
| 57 | c.flush(); |
| 58 | |
| 59 | File.WriteAllBytes("test0.bin", s); |
| 60 | File.WriteAllBytes("test1.bin", bc.Buffer.Copy()); |
| 61 | Console.WriteLine("OK"); |
| 62 | |
| 63 | } |
| 64 | public static void Main(string[] args) |
| 65 | { |
| 66 | Test2(); |