Revert "Revert "Add support for custom buffer sizes..""

This reverts commit 84fe43f095d8cf01ef4f99f5f0fce983b582c082.