Prefer ByteSourcePayload which offers a superset of its functionality. Note that ByteArrayPayload implicitly set the contentLength while users of ByteSourcePayload must do so explicitly.