build a buffer without a certain length