variable length buffer implemented and used for escape/unescape.