Converted the buf variable to a class member variable.