added buffer support
Merge pull request #41 from lob/add-buffer-support

added buffer support