public object Clone() { MyBuffer clone = new MyBuffer(); clone.DataBuffer = (byte[])this.DataBuffer.Clone(); clone.Head = this.Head; clone.Size = this.Size; return(clone); }
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; }