Finally, after analysis of the sources I realized that bop() should be used to go to the beginning of the buffer. The question is closed.
Finally, after analysis of the sources I realized that eop() should be used to go to the beginning of the buffer. The question is closed.
Memory leaks in clear()