use array access when possible to speed up buffer conversion