optimization for buffer write easy cases

#170 no bug never existed

#170 complete write tests for status quo

fix regression: nitems adjusted at the wrong location

(0) -300 -100 -30 -10 -4 +4 +10 +30 +100 +300 tip

mercurial