this.content = BytesArray.EMPTY;
this.contentType = TEXT_CONTENT_TYPE;
} else {
XContentBuilder builder = convert(channel, status, t);
this.content = builder.bytes();
this.contentType = builder.contentType().restContentType();
}
if (t instanceof HasRestHeaders) {
addHeaders(((HasRestHeaders) t).getHeaders());
}
this.contentThreadSafe = true;