tokenize buffer