#1158 add buffer support