Store buffer length in a field instead of using the length operator