fixed error in read position of buffer with compiled writer