Add buffer getter for input class and add reference for foreach loop