Exemplo n.º 1
0
        public object Clone()
        {
            MyBuffer clone = new MyBuffer();

            clone.DataBuffer = (byte[])this.DataBuffer.Clone();
            clone.Head       = this.Head;
            clone.Size       = this.Size;
            return(clone);
        }
Exemplo n.º 2
0
 public void Add(MyBuffer addBuffer)
 {
     lock (this.DataBuffer)
     {
         if (this.Tail + addBuffer.Size > this.DataBuffer.Length)
         {
             throw new ArgumentOutOfRangeException("buffers are too small?");
         }
         Buffer.BlockCopy(addBuffer.DataBuffer, addBuffer.Head, this.DataBuffer, this.Tail, addBuffer.Size);
     }
     this.Size += addBuffer.Size;
 }