Modified `bufSize` to be changeable and added test case.