Пример #1
0
        public override void ToBBuffer(BBuffer bb)
        {
            bb.Reserve(bb.dataLen + 58 * 4);
            var nexts = new int[2];

            nexts[0] = inext;
            nexts[1] = inextp;
            Buffer.BlockCopy(nexts, 0, bb.buf, bb.dataLen, 8);
            Buffer.BlockCopy(SeedArray, 0, bb.buf, bb.dataLen + 8, 56 * 4);
            bb.dataLen += 58 * 4;
        }
Пример #2
0
        public override void ToBBuffer(BBuffer bb)
        {
            var len = dataLen;

            bb.WriteLength(len);
            if (len == 0)
            {
                return;
            }
            bb.Ensure(len);
            Buffer.BlockCopy(buf, 0, bb.buf, bb.dataLen, len);
            bb.dataLen += len;
        }
Пример #3
0
        public override void FromBBuffer(BBuffer bb)
        {
            if (bb.offset + 58 * 4 > bb.dataLen)
            {
                throw new IndexOutOfRangeException();
            }
            var nexts = new int[2];

            inext  = nexts[0];
            inextp = nexts[1];
            Buffer.BlockCopy(bb.buf, bb.offset, nexts, 0, 8);
            Buffer.BlockCopy(bb.buf, bb.offset + 8, SeedArray, 0, 56 * 4);
            bb.offset += 58 * 4;
        }
Пример #4
0
        public override void FromBBuffer(BBuffer bb)
        {
            int len = bb.ReadLength();

            if (bb.readLengthLimit != 0 && len > bb.readLengthLimit)
            {
                throw new Exception("overflow of limit");
            }
            Resize(len);
            offset = 0;
            if (len == 0)
            {
                return;
            }
            Buffer.BlockCopy(bb.buf, bb.offset, buf, 0, len);
            bb.offset += len;
        }
Пример #5
0
 public virtual void ToBBuffer(BBuffer bb)
 {
 }
Пример #6
0
 public virtual void FromBBuffer(BBuffer bb)
 {
 }
Пример #7
0
 public void ToBBuffer(BBuffer bb)
 {
     bb.Write(x);
     bb.Write(y);
 }
Пример #8
0
 public void FromBBuffer(BBuffer bb)
 {
     bb.Read(ref x);
     bb.Read(ref y);
 }