private static void CheckIndexBounds(int readerIndex, int writerIndex, int capacity) { if (readerIndex < 0 || readerIndex > writerIndex || writerIndex > capacity) { ThrowHelper.ThrowIndexOutOfRangeException_CheckIndexBounds(readerIndex, writerIndex, capacity); } }