minor: use the buffer size getter instead of the local variable (it is more logical that way, helps read the code)