added variable-length integer support to Buffer