ported #writeBodyBytes to native parser