[buffer] Fix toString() method

Now it correctly does not include 'end' index