public void Generate()
        {
            RG.Init();
            Rep0 = 1;
            while (Pos < BufferSize)
            {
                if (GetRndBit() == 0 || Pos < 1)
                {
                    Buffer[Pos++] = (byte) RG.GetRnd(8);
                }
                else
                {
                    int len;
                    if (RG.GetRnd(3) == 0)
                    {
                        len = 1 + GetLen1();
                    }
                    else
                    {
                        do
                        {
                            Rep0 = GetOffset();
                        } while (Rep0 >= Pos);
                        Rep0++;
                        len = 2 + GetLen2();
                    }
                    for (int i = 0; i < len && Pos < BufferSize; i++, Pos++)
                    {
                        Buffer[Pos] = Buffer[Pos - Rep0];
                    }
                }
            }
        }