Add support for custom buffer sizes