Manually write unsigned shorts into the buffer for performance