Okie.. I have used this logic now.  I did not want to do checks with comparing the byte, if it is a seperator byte or not.  the reason i thought was that it would always do a comparison.  That is why wanted to ensure it thro other ways.
One small thing if we see the first character as null in curroffset, we may have to know the next offset to know if both are same and then say the needed element is null if not we need to increase the currOff by 2 to read the next element.