Buffer: fixed method EnsureCapacityToWrite