public override int Available() { lock (thisLock) { if (start <= end) { return (end - start); } return ((buffer.Length - start) + end); } }