public void Add(byte[] buffers) { lock (LockObject) { if (buffers == null || buffers.Length == 0) { return; } Data = ByteUtil.AppendByteArray(Data, buffers); Monitor.PulseAll(LockObject); } }
public void Remove(int index, int bufferLength) { lock (LockObject) { if (bufferLength == 0) { return; } if (Length < index + bufferLength) { return; } byte[] beforeBytes = ByteUtil.InterceptByteArray(Data, 0, index); byte[] afterBytes = ByteUtil.InterceptByteArray(Data, index + bufferLength, Length - index - bufferLength); Data = ByteUtil.AppendByteArray(beforeBytes, afterBytes); Monitor.PulseAll(LockObject); } }