keep track of written bytes during for intial ringbuffer

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>