completed port of #readBodyBytes