If Dcsbuffer is empty, currentIndex is -1, you can also set currentIndex to -1.
If DcsBuffer is not empty, when you set currentIndex to a value =count, it will fail and throw an exception called DcsValueOutOfRangeException.