use direct buffer for encoding