added new clear the buffer function

added new clear the buffer function
Merge pull request #2922 from AdaskoTheBeAsT/master

added new clear the buffer function